Include directives with \\0 (on Windows)
Status: Pre-Alpha
Brought to you by:
jeffmoore
On line 176 in the file
framework/template/compiler/codewriter.inc.php, a
preg_replace replaces the first occurence of "<?php "
in the file with the include directives. But, if
$includecode contains "\\0", this will be replaced with
"<?php " (http://www.php.net/preg_replace). On Windows,
directories are seperated using a backslashed backslash
(\\). So, if there's a directory starting with "0",
it's replaced with "<?php ".
For example, if $includecode contains
require_once 'C:\\php\\myproject\\0.9\\file.php';
the "\\0" is replaced with "<?php ", and this becomes
require_once 'C:\\php\\myproject<?php .9\\file.php';
resulting in an error.
Logged In: YES
user_id=1303526
This can easily be fixed by changing line 176 from:
return preg_replace($pattern, '<?php ' . $includecode,
$this->code, 1);
into:
return preg_replace($pattern, '<?php ' . str_replace('\\',
'/', $includecode), $this->code, 1);
Anyway, I don't think I can change it in the CVS (at least
not without installing a CVS client), so could someone
change it it the code?