From: Brion Vibber Date: Mon, 25 Oct 2004 02:33:33 +0000 (+0000) Subject: Fix broken escaped include path which breaks some but not all Windows installs. X-Git-Tag: 1.5.0alpha1~1449 X-Git-Url: http://git.cyclocoop.org/clavettes/images/siteon3.jpg?a=commitdiff_plain;h=3297c39e296e8e600a245960aea91100ac7eedc2;p=lhc%2Fweb%2Fwiklou.git Fix broken escaped include path which breaks some but not all Windows installs. --- diff --git a/PHPTAL-NP-0.7.0/libs/PHPTAL/Generator.php b/PHPTAL-NP-0.7.0/libs/PHPTAL/Generator.php index 147b0a02d1..3707694ec1 100644 --- a/PHPTAL-NP-0.7.0/libs/PHPTAL/Generator.php +++ b/PHPTAL-NP-0.7.0/libs/PHPTAL/Generator.php @@ -81,8 +81,12 @@ class PHPTAL_Generator $this->_code .= $code; } if ($this->_gettext_required) { + # Protect against the string and the inclusion. + # Note: some really obscure characters might still break. + $path = addslashes( PT_IP ); + $path = str_replace( array( '$', '\\' ), array( '\\$', '\\\\' ), $path ); $this->_code = preg_replace('/^<\?php/sm', - '_code, 1); }