Re: [SMARTY-DEV] File Perms
| From: | messju mohr | Date: | Thu, 16 Nov 2006 15:35:07 +0000 |
| Subject: | Re: [SMARTY-DEV] File Perms | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2907@lists.php.net to get a copy of this message | ||
Hi,
On Thu, Nov 16, 2006 at 04:10:28PM +0100, Bas Kamer wrote:
> Hi,
>
> i have a quick improvement for smarty for people using the
> _file_perms property.
>
> in file
>
> smarty-2.6.14/libs/internals/core.write_file.php:47
>
> - @chmod($params['filename'], $smarty->_file_perms);
> + @chmod($params['filename'], octdec($smarty->_file_perms));
>
> This improves file chmod behavior...
Erm, actually it breaks it, IMHO.
> on my installation a setting of (string) "0666" yields very
> unexpected results unless i use the octdec method...
You should sanitize this value outside of smarty, then.
greetings
messju
> please note that in my case this string is not hardcoded into the
> smart class, but dynamically written at some point (eventough it is
> designated as 'private', which is why????)
>
> thanks... good luck, it a very nice product.
>
> Just like to contribute something here...
> ps. If this is not the correct place for this please let me know...
It is the right place. I'm just strongly against what you propose. ;-)
> references: http://www.php.net/octdec
> and the comment on
> http://nl3.php.net/manual/en/function.chmod.php#56077
>
> again
>
> thanks a lot...
>
> Bas Kamer