From efaa653426b9ddb5244c60e4af12d71ecf8f3850 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 27 Sep 2004 03:05:20 +0000 Subject: [PATCH] * Hacky fix for PHPTAL 0.7 bug to be consistent with PHPTAL 1.0 (${foo} interpolations not escaped) * Switch usercss & userjs bits due to above; SkinPHPTal now sets them _with_ the CDATA markers, as PHPTAL seems unwilling to recognize XML tags with tal: bits on them inside a CDATA section in the template (though oddly enough it interpreted the ${bits} just fine!) --- PHPTAL-NP-0.7.0/libs/PHPTAL/ExpressionFunctions.php | 6 +++++- includes/SkinPHPTal.php | 4 ++++ skins/MonoBook.pt | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/PHPTAL-NP-0.7.0/libs/PHPTAL/ExpressionFunctions.php b/PHPTAL-NP-0.7.0/libs/PHPTAL/ExpressionFunctions.php index c13a71c8cc..a81897fc9c 100644 --- a/PHPTAL-NP-0.7.0/libs/PHPTAL/ExpressionFunctions.php +++ b/PHPTAL-NP-0.7.0/libs/PHPTAL/ExpressionFunctions.php @@ -103,7 +103,11 @@ function PHPTAL_ES_path_toString(&$exp, $value) if ($value == "nothing") { return 'null'; } if ($value == "default") { return '$__default__'; } if (preg_match('/^@[_a-z][0-9a-z_]*$/i', $value)) { return substr($value, 1); } - return '$__ctx__->getToString("'. $value .'")'; +# HACKHACKHACKHACKHACK! <- for fixing ${foo} not being escaped. +# In PHPTAL 1.0.0 it _is_ escaped, and apparently it's supposed to be. +# We need to be consistent to work on both. +# return '$__ctx__->getToString("'. $value .'")'; + return 'htmlspecialchars($__ctx__->get("'. $value .'"))'; } diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index a836f297d1..15d65a95ea 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -707,6 +707,10 @@ class SkinPHPTal extends Skin { $this->userjs = $this->makeUrl($this->userpage.'/'.$this->skinname.'.js', 'action=raw&ctype=text/javascript&dontcountme=s'); } } + $this->usercss = '/*usercss . ' /*]]>*/'; + if( $this->userjsprev ) { + $this->userjsprev = '/*userjsprev . ' /*]]>*/'; + } } /** diff --git a/skins/MonoBook.pt b/skins/MonoBook.pt index 14774240aa..d863e20058 100644 --- a/skins/MonoBook.pt +++ b/skins/MonoBook.pt @@ -11,9 +11,9 @@ - + + tal:condition="userjsprev" tal:content="structure userjsprev" type="text/javascript">
-- 2.20.1