Re: more abstraction committed - Bug

From: Date: Sat, 10 May 2003 09:41:33 +0000
Subject: Re: more abstraction committed - Bug
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1438@lists.php.net to get a copy of this message
Monte Ohrt schrieb in php.smarty.dev: > Anyways, a LOT has changed here so bugs may be present. I tried to test > as good as I could, but please help! Hi, core.create_dir_structure create an corrupt $_new_dir (contains only the path to templates_c) on my Windows-Box. Changing to the old behaviour of path-building solve this. And please correct the triggered error - it was a little bit confusing.. :) cvs -q diff -u -w Index: core.create_dir_structure.php =================================================================== RCS file: /repository/smarty/libs/plugins/core.create_dir_structure.php,v retrieving revision 1.1 diff -u -w -r1.1 core.create_dir_structure.php --- core.create_dir_structure.php 8 May 2003 20:21:16 -0000 1.1 +++ core.create_dir_structure.php 10 May 2003 09:27:25 -0000 @@ -16,10 +16,9 @@ function smarty_core_create_dir_structure($params, &$this) { if (!file_exists($params['dir'])) { - $_new_dir = (preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $params ['dir'])) - ? DIRECTORY_SEPARATOR : getcwd().DIRECTORY_SEPARATOR; $_dir_parts = preg_split('!\\' . DIRECTORY_SEPARATOR . '+!', $params['dir'], -1, PREG_SPLIT_NO_EMPTY); + $_new_dir = ($params['dir']{0} == DIRECTORY_SEPARATOR) ? DIRECTORY_SEPARATOR : ''; // do not attempt to test or make directories outside of open_basedir $_open_basedir_ini = ini_get('open_basedir'); @@ -46,7 +45,7 @@ } if ($_make_new_dir && !file_exists($_new_dir) && !@mkdir ($_new_dir, $this->_dir_perms)) { - $this->trigger_error("problem creating directory '" . $params['dir'] . "'"); + $this->trigger_error("problem creating directory '" . $_new_dir . "'"); return false; } $_new_dir .= DIRECTORY_SEPARATOR; > -- http://4bconsult.de

« previous php.smarty.dev (#1438) next »