Re: Problem with custom resource compiled filenames

"messju mohr" <[email protected]> Mon, 22 Aug 2005 13:38:28 +0200
Newsgroups gmane.comp.php.smarty.devel
Message-ID <20050822113828.GA25267@dune>
Hi,

how would you handle the case that the filenames is invalid just
because it is too long?

greetings
messju

On Mon, Aug 22, 2005 at 12:51:11PM +0200, Ivo Jansch wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi
> 
> Ivo Jansch wrote:
> 
> > Monte, do you know of a correct way to solve this? I'd be happy to
> > contribute a fix, just point me to the proper place where to solve this.
> 
> It appears, that in _get_auto_filename in Smarty.class.php, this piece
> of code:
> 
> if(isset($auto_source))
> {
>   // make source name safe for filename
>   $_filename = urlencode(basename($auto_source));
>   $_crc32 = sprintf('%08X', crc32($auto_source));
>   // prepend %% to avoid name conflicts with
>   // with $params['auto_id'] names
>   $_crc32 = substr($_crc32, 0, 2) . $_compile_dir_sep .
>             substr($_crc32, 0, 3) . $_compile_dir_sep . $_crc32;
>   $_return .= '%%' . $_crc32 . '%%' . $_filename;
> }
> 
> somehow results in an invalid filename anyway. I'm investigating further..
> 
> Greetings,
> Ivo
> 
> - --
> Ivo Jansch <[email protected]>
> ibuildings.nl BV - information technology
> http://www.ibuildings.nl
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (MingW32)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iD8DBQFDCa4f95NUnGFZm9cRAgc9AKCwjIkNhR5HiYR6y/LRy78vIooi6QCeOqeo
> OQIoZKSyM5KeyruZVJOmgxc=
> =k4EE
> -----END PGP SIGNATURE-----
> 
> -- 
> Smarty Development Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php