From: Fabien Potencier Date: Thu, 14 Jun 2012 15:05:56 +0000 (+0200) Subject: fixed paths in the filesystem loader when passing a path that ends with a slash or... X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=120c44d68f07ced5b1e08f582f94016f4f2685d6;p=web%2Fkonrad%2Ftwig.git fixed paths in the filesystem loader when passing a path that ends with a slash or a backslash (closes #750) --- diff --git a/CHANGELOG b/CHANGELOG index fcbd919..54cd454 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ * 1.8.3 (2012-XX-XX) + * fixed paths in the filesystem loader when passing a path that ends with a slash or a backslash * fixed escaping when a project defines a function named html or js * fixed chmod mode to apply the umask correctly diff --git a/lib/Twig/Loader/Filesystem.php b/lib/Twig/Loader/Filesystem.php index fd93219..18104a5 100644 --- a/lib/Twig/Loader/Filesystem.php +++ b/lib/Twig/Loader/Filesystem.php @@ -71,7 +71,7 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path)); } - $this->paths[] = $path; + $this->paths[] = rtrim($path, '/\\'); } /**