From: Brion Vibber Date: Mon, 27 Sep 2004 01:30:27 +0000 (+0000) Subject: More fixes for PHPTAL 1.0 on PHP5. Apparently it's a bug in PHPTAl 0.7 that X-Git-Tag: 1.5.0alpha1~1761 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=e2a9e9fbd8376eff4a9f5dc2ba9bf7b85f0f3b31;p=lhc%2Fweb%2Fwiklou.git More fixes for PHPTAL 1.0 on PHP5. Apparently it's a bug in PHPTAl 0.7 that substitutions with ${name} are not HTML-escaped... Replaced various inline bits with tal:content or tal:replace using the 'structure' keyword to do this in a compatible way, but some bits may be remaining. Also changed some uses to tal:attributes, and took the htmlspecialchars() off of the settings in SkinPHPTal to let them get escaped normally. The main page logo link is currently bitten by this as i18n:attributes and tal:attributes can't be used together on 0.7.0; this needs tweaking. PHPTAL 1.0 currently doesn't escape the tal:attributes bits, but this seems to be a simple bug and should be fixed soon, I hope. --- diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index 9aa80dd0d7..a836f297d1 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -590,25 +590,25 @@ class SkinPHPTal extends Skin { $diff = $wgRequest->getVal( 'diff' ); // XXX: remove htmlspecialchars when tal:attributes works with i18n:attributes $nav_urls = array(); - $nav_urls['mainpage'] = array('href' => htmlspecialchars( $this->makeI18nUrl('mainpage'))); - $nav_urls['randompage'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Randompage'))); - $nav_urls['recentchanges'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchanges'))); - $nav_urls['currentevents'] = (wfMsg('currentevents') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('currentevents'))) : false; - $nav_urls['portal'] = (wfMsg('portal') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('portal-url'))) : false; - $nav_urls['bugreports'] = array('href' => htmlspecialchars( $this->makeI18nUrl('bugreportspage'))); - // $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $this->makeI18nUrl('sitesupportpage'))); - $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $wgSiteSupportPage)); - $nav_urls['help'] = array('href' => htmlspecialchars( $this->makeI18nUrl('helppage'))); + $nav_urls['mainpage'] = array('href' => $this->makeI18nUrl('mainpage')); + $nav_urls['randompage'] = array('href' => $this->makeSpecialUrl('Randompage')); + $nav_urls['recentchanges'] = array('href' => $this->makeSpecialUrl('Recentchanges')); + $nav_urls['currentevents'] = (wfMsg('currentevents') != '-') ? array('href' => $this->makeI18nUrl('currentevents')) : false; + $nav_urls['portal'] = (wfMsg('portal') != '-') ? array('href' => $this->makeI18nUrl('portal-url')) : false; + $nav_urls['bugreports'] = array('href' => $this->makeI18nUrl('bugreportspage')); + // $nav_urls['sitesupport'] = array('href' => $this->makeI18nUrl('sitesupportpage')); + $nav_urls['sitesupport'] = array('href' => $wgSiteSupportPage); + $nav_urls['help'] = array('href' => $this->makeI18nUrl('helppage')); if( $this->loggedin && !$wgDisableUploads ) { - $nav_urls['upload'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Upload'))); + $nav_urls['upload'] = array('href' => $this->makeSpecialUrl('Upload')); } else { $nav_urls['upload'] = false; } - $nav_urls['specialpages'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Specialpages'))); + $nav_urls['specialpages'] = array('href' => $this->makeSpecialUrl('Specialpages')); if( $wgTitle->getNamespace() != NS_SPECIAL) { - $nav_urls['whatlinkshere'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Whatlinkshere', 'target='.urlencode( $this->thispage )))); - $nav_urls['recentchangeslinked'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchangeslinked', 'target='.urlencode( $this->thispage )))); + $nav_urls['whatlinkshere'] = array('href' => $this->makeSpecialUrl('Whatlinkshere', 'target='.urlencode( $this->thispage))); + $nav_urls['recentchangeslinked'] = array('href' => $this->makeSpecialUrl('Recentchangeslinked', 'target='.urlencode( $this->thispage))); } if( $wgTitle->getNamespace() == NS_USER || $wgTitle->getNamespace() == NS_USER_TALK ) { @@ -621,7 +621,7 @@ class SkinPHPTal extends Skin { if($id || $ip) { # both anons and non-anons have contri list $nav_urls['contributions'] = array( - 'href' => htmlspecialchars( $this->makeSpecialUrl('Contributions', "target=" . $wgTitle->getPartialURL() ) ) + 'href' => $this->makeSpecialUrl('Contributions', "target=" . $wgTitle->getPartialURL() ) ); } else { $nav_urls['contributions'] = false; @@ -630,7 +630,7 @@ class SkinPHPTal extends Skin { if ( 0 != $wgUser->getID() ) { # show only to signed in users if($id) { # can only email non-anons $nav_urls['emailuser'] = array( - 'href' => htmlspecialchars( $this->makeSpecialUrl('Emailuser', "target=" . $wgTitle->getPartialURL() ) ) + 'href' => $this->makeSpecialUrl('Emailuser', "target=" . $wgTitle->getPartialURL() ) ); } } diff --git a/skins/MonoBook.pt b/skins/MonoBook.pt index aa5e344f73..14774240aa 100644 --- a/skins/MonoBook.pt +++ b/skins/MonoBook.pt @@ -2,7 +2,7 @@ - ${headlinks} +
Exciting xhtml slimfast @@ -12,14 +12,14 @@ -
- +

Leonardo da Vinci

@@ -28,10 +28,10 @@
- ${bodytext} +
-
+
@@ -72,7 +72,7 @@ - ${reporttime} +