From 3297c39e296e8e600a245960aea91100ac7eedc2 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 25 Oct 2004 02:33:33 +0000 Subject: [PATCH] Fix broken escaped include path which breaks some but not all Windows installs. --- PHPTAL-NP-0.7.0/libs/PHPTAL/Generator.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } -- 2.20.1