Re: [SMARTY-DEV] Re: more abstraction committed - Bug
| From: | messju mohr | Date: | Sat, 10 May 2003 10:30:50 +0000 |
| Subject: | Re: [SMARTY-DEV] Re: more abstraction committed - Bug | ||
| References: | 1 2 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1439@lists.php.net to get a copy of this message | ||
On Sat, May 10, 2003 at 09:41:33AM -0000, Thomas Schulz wrote:
> 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.
can you tell me which settings make core.create_dir_structure break?
do you use open_basedir? do you use relative or absolute paths?
do you use forward-slashes or backslashes in the paths you configure?
> And please correct the triggered error - it was a little bit confusing.. :)
yes, done.
> 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
>
> --
> Smarty Development Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php