From 77abff1e53ea71401a681c6f4578a58bf4feec4a Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Thu, 18 Jun 2015 03:07:19 +0200 Subject: [PATCH] normalize path --- tests/PHPUnit_Smarty.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/PHPUnit_Smarty.php b/tests/PHPUnit_Smarty.php index 4aca9a27..6fd05eb7 100644 --- a/tests/PHPUnit_Smarty.php +++ b/tests/PHPUnit_Smarty.php @@ -103,6 +103,9 @@ class PHPUnit_Smarty extends PHPUnit_Framework_TestCase */ public function __construct($name = null, array $data = array(), $dataName = '') { + if (!defined('individualFolders')) { + define('individualFolders', true); + } parent::__construct($name, $data, $dataName); $this->backupStaticAttributesBlacklist[get_class($this)] = array('init', 'config', 'pdo'); } @@ -369,9 +372,9 @@ KEY `expire` (`expire`) if ($path[0] == '.') { $path = getcwd() . DS . $path; } - $path = preg_replace('#[\\\/]+([.][\\\/]+)*([.](?![.]))?#', DS, $path); - while (strrpos($path, DS . '.') !== false) { - $path = preg_replace('#([\\\/]([^\\\/]+[\\\/]){2}([.][.][\\\/]){2})|([\\\/][^\\\/]+[\\\/][.][.][\\\/]?)#', DS, $path); + $path = preg_replace('#[\\\/]+([.][\\\/]+)*#', DS, $path); + while (strrpos($path, '.' . DS) !== false) { + $path = preg_replace('#([\\\/]([^\\\/]+[\\\/]){2}([.][.][\\\/]){2})|([\\\/][^\\\/]+[\\\/][.][.][\\\/])#', DS, $path); } return $path; }