{"action":"created","issue":{"url":"https://api.github.com/repos/twigphp/Twig/issues/2145","repository_url":"https://api.github.com/repos/twigphp/Twig","labels_url":"https://api.github.com/repos/twigphp/Twig/issues/2145/labels{/name}","comments_url":"https://api.github.com/repos/twigphp/Twig/issues/2145/comments","events_url":"https://api.github.com/repos/twigphp/Twig/issues/2145/events","html_url":"https://github.com/twigphp/Twig/issues/2145","id":179090331,"number":2145,"title":"BC break regarding relative paths in 1.25 due to realpath changes (#2127) ","user":{"login":"Nicofuma","id":591456,"avatar_url":"https://avatars.githubusercontent.com/u/591456?v=3","gravatar_id":"","url":"https://api.github.com/users/Nicofuma","html_url":"https://github.com/Nicofuma","followers_url":"https://api.github.com/users/Nicofuma/followers","following_url":"https://api.github.com/users/Nicofuma/following{/other_user}","gists_url":"https://api.github.com/users/Nicofuma/gists{/gist_id}","starred_url":"https://api.github.com/users/Nicofuma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nicofuma/subscriptions","organizations_url":"https://api.github.com/users/Nicofuma/orgs","repos_url":"https://api.github.com/users/Nicofuma/repos","events_url":"https://api.github.com/users/Nicofuma/events{/privacy}","received_events_url":"https://api.github.com/users/Nicofuma/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-09-25T14:57:54Z","updated_at":"2016-09-29T12:45:50Z","closed_at":null,"body":"The 1.25 version does not allow relative loading paths ($this->paths) in the filesystem loader anymore.\r\n\r\nThe new `normalizePath()` method is more strict than `realpath()` as it does not allow relative paths (any extra `../` will be ignored). It means that if you have a FilesystemLoader configured with a relative directory in the paths list, the result of `findTemplate()` will be different than in the 1.24 version.\r\n\r\nThe result will also be wrong because the `is_file()` check (https://github.com/twigphp/Twig/blob/1.x/lib/Twig/Loader/Filesystem.php#L200) will succeed but the returned path won't lead to an existing file, as a result a warning will be thrown by `getSource()`.\r\n\r\nReproducer (expecting true with both 1.24 and 1.25): \r\n```\r\n<?php\r\n\r\ninclude 'vendor/autoload.php';\r\n\r\n$parts = explode('/', __FILE__);\r\n$filename = array_pop($parts);\r\n$dirname = array_pop($parts);\r\n\r\n$loader = new Twig_Loader_Filesystem('../'.$dirname);\r\n$r = new ReflectionMethod($loader, 'findTemplate');\r\n$r->setAccessible(true);\r\nvar_dump(__FILE__ === $r->invoke($loader, $filename));\r\n```"},"comment":{"url":"https://api.github.com/repos/twigphp/Twig/issues/comments/250455560","html_url":"https://github.com/twigphp/Twig/issues/2145#issuecomment-250455560","issue_url":"https://api.github.com/repos/twigphp/Twig/issues/2145","id":250455560,"user":{"login":"enzolutions","id":907914,"avatar_url":"https://avatars.githubusercontent.com/u/907914?v=3","gravatar_id":"","url":"https://api.github.com/users/enzolutions","html_url":"https://github.com/enzolutions","followers_url":"https://api.github.com/users/enzolutions/followers","following_url":"https://api.github.com/users/enzolutions/following{/other_user}","gists_url":"https://api.github.com/users/enzolutions/gists{/gist_id}","starred_url":"https://api.github.com/users/enzolutions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enzolutions/subscriptions","organizations_url":"https://api.github.com/users/enzolutions/orgs","repos_url":"https://api.github.com/users/enzolutions/repos","events_url":"https://api.github.com/users/enzolutions/events{/privacy}","received_events_url":"https://api.github.com/users/enzolutions/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T12:45:50Z","updated_at":"2016-09-29T12:45:50Z","body":"Inside the [Drupal Console](http:.//drupalconsole.com) project we have the same issue inside a phar, as @kimpepper reported.\r\n\r\nWe had to return to *1.23.1*  and all works as expected.\r\n"}}
{"actor":{"display_login":"enzolutions"}}