r91 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90‎ | r91 | r92 >
Date:03:51, 8 February 2002
Author:vibber
Status:old
Tags:
Comment:
Prevent diff pages from being cached; paranoid HTML escaping on hovers
Modified paths:
  • /trunk/phpwiki/fpw/wikiPage.php (modified) (history)

Diff [purge]

Index: trunk/phpwiki/fpw/wikiPage.php
@@ -321,7 +321,7 @@
322322 $this->otherLanguages[$topic->namespace] = $iwl ;
323323 } else if ( $doesItExist ) {
324324 $linkedLinks[$topic->secureTitle]++ ;
325 - if ( $user->options["showHover"] == "yes" ) $hover = "title=\"$link\"" ;
 325+ if ( $user->options["showHover"] == "yes" ) $hover = "title=\"" . htmlspecialchars ( $link ) . "\"" ;
326326 #if ( $user->options["underlineLinks"] == "no" ) $linkStyle = " style=\"color:blue;text-decoration:none\"" ;
327327 $ulink = nurlencode ( $link ) ;
328328 $s .= "<a href=\"".wikiLink($ulink)."\" $hover$linkStyle>$text</a>" ;
@@ -329,7 +329,7 @@
330330 $unlinkedLinks[$link]++ ;
331331 #$text2 = $text ;
332332 #$style="" ;
333 - if ( $user->options["showHover"] == "yes" ) $hover = "title=\"Edit '$link'\"" ;
 333+ if ( $user->options["showHover"] == "yes" ) $hover = "title=\"Edit '" . htmlspecialchars ( $link ) . "'\"" ;
334334 #if ( substr_count ( $text2 , " " ) > 0 ) {
335335 # if ( $action == "print" ) $text2 = "<$wikiPrintLinksMarkup>$text2</$wikiPrintLinksMarkup>" ;
336336 # else $text2 = "[$text2]" ;
@@ -1061,9 +1061,12 @@
10621062 function renderPage ( $doPrint = false ) {
10631063 global $pageTitle , $diff , $wikiArticleSource , $wikiCurrentServer , $wikiPrintLinksMarkup , $useCachedPages ;
10641064 $pageTitle = $this->title ;
1065 - if ( isset ( $diff ) ) $middle = $this->doDiff().$this->contents ;
 1065+ if ( isset ( $diff ) ) {
 1066+ $middle = $this->doDiff().$this->contents ;
 1067+ $useCachedPages = false; # A little crude, but effective
 1068+ }
10661069 else $middle = $this->contents ;
1067 - if ( $useCachedPages and !$this->isSpecialPage ) {
 1070+ if ( $useCachedPages and !$this->isSpecialPage) {
10681071 if ( $this->cache != "" ) { # Using cache
10691072 $middle = $this->cache ;
10701073 } else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r56695New version of spyc (r91)nikerabbit08:10, 21 September 2009
r71889New version of spyc (r91)...siebrand17:39, 29 August 2010

Status & tagging log