enhanced auto-generated filenames for templates_c and cache

incremented Smarty::_version because the tempfiles' structure changed
a little
This commit is contained in:
messju
2004-05-26 15:26:41 +00:00
parent 9b25a0b2f6
commit 72fdad0064
2 changed files with 6 additions and 4 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- enhanced auto-generated filenames for templates_c and cache (messju)
- add 'nonstd' to escape modifier for escaping non-std chars, - add 'nonstd' to escape modifier for escaping non-std chars,
such as ms doc quote (Monte) such as ms doc quote (Monte)
- adjusted textformat to not output wrap chars after last para - adjusted textformat to not output wrap chars after last para

View File

@@ -459,7 +459,7 @@ class Smarty
* *
* @var string * @var string
*/ */
var $_version = '2.6.3-dev'; var $_version = '2.6.3-dev-2';
/** /**
* current template inclusion depth * current template inclusion depth
@@ -1747,11 +1747,12 @@ class Smarty
if(isset($auto_source)) { if(isset($auto_source)) {
// make source name safe for filename // make source name safe for filename
$_filename = urlencode(basename($auto_source)); $_filename = urlencode(basename($auto_source));
$_crc32 = crc32($auto_source) . $_compile_dir_sep; $_crc32 = sprintf("%08X", crc32($auto_source));
// prepend %% to avoid name conflicts with // prepend %% to avoid name conflicts with
// with $params['auto_id'] names // with $params['auto_id'] names
$_crc32 = '%%' . substr($_crc32,0,3) . $_compile_dir_sep . '%%' . $_crc32; $_crc32 = substr($_crc32, 0, 2) . $_compile_dir_sep .
$_return .= $_crc32 . $_filename; substr($_crc32, 0, 3) . $_compile_dir_sep . $_crc32;
$_return .= '%%' . $_crc32 . '%%' . $_filename;
} }
return $_return; return $_return;