From 120c44d68f07ced5b1e08f582f94016f4f2685d6 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 14 Jun 2012 17:05:56 +0200 Subject: [PATCH] fixed paths in the filesystem loader when passing a path that ends with a slash or a backslash (closes #750) --- CHANGELOG | 1 + lib/Twig/Loader/Filesystem.php | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-) 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, '/\\'); } /** -- 1.7.2.5