r23068 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23067‎ | r23068 | r23069 >
Date:13:34, 18 June 2007
Author:nikerabbit
Status:old
Tags:
Comment:
* Escape the output of magic variables that return page name or part of it
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -2455,25 +2455,25 @@
24562456 case 'localday2':
24572457 return $varCache[$index] = $wgContLang->formatNum( $localDay2 );
24582458 case 'pagename':
2459 - return $this->mTitle->getText();
 2459+ return wfEscapeWikiText( $this->mTitle->getText() );
24602460 case 'pagenamee':
24612461 return $this->mTitle->getPartialURL();
24622462 case 'fullpagename':
2463 - return $this->mTitle->getPrefixedText();
 2463+ return wfEscapeWikiText( $this->mTitle->getPrefixedText() );
24642464 case 'fullpagenamee':
24652465 return $this->mTitle->getPrefixedURL();
24662466 case 'subpagename':
2467 - return $this->mTitle->getSubpageText();
 2467+ return wfEscapeWikiText( $this->mTitle->getSubpageText() );
24682468 case 'subpagenamee':
24692469 return $this->mTitle->getSubpageUrlForm();
24702470 case 'basepagename':
2471 - return $this->mTitle->getBaseText();
 2471+ return wfEscapeWikiText( $this->mTitle->getBaseText() );
24722472 case 'basepagenamee':
24732473 return wfUrlEncode( str_replace( ' ', '_', $this->mTitle->getBaseText() ) );
24742474 case 'talkpagename':
24752475 if( $this->mTitle->canTalk() ) {
24762476 $talkPage = $this->mTitle->getTalkPage();
2477 - return $talkPage->getPrefixedText();
 2477+ return wfEscapeWikiText( $talkPage->getPrefixedText() );
24782478 } else {
24792479 return '';
24802480 }
@@ -2486,7 +2486,7 @@
24872487 }
24882488 case 'subjectpagename':
24892489 $subjPage = $this->mTitle->getSubjectPage();
2490 - return $subjPage->getPrefixedText();
 2490+ return wfEscapeWikiText( $subjPage->getPrefixedText() );
24912491 case 'subjectpagenamee':
24922492 $subjPage = $this->mTitle->getSubjectPage();
24932493 return $subjPage->getPrefixedUrl();
Index: trunk/phase3/RELEASE-NOTES
@@ -174,8 +174,8 @@
175175 {{LOCAL*}} functions return local time per server config or $wgLocaltimezone.
176176 Signature dates for Japanese and other languages including weekday now show
177177 the correct day to match the rest of the time in local time.
 178+* Escape the output of magic variables that return page name or part of it
178179
179 -
180180 == API changes since 1.10 ==
181181
182182 (For ongoing development discussion, see http://www.mediawiki.org/wiki/API)

Follow-up revisions

RevisionCommit summaryAuthorDate
r23087Merged revisions 23050-23086 via svnmerge from...david03:14, 19 June 2007

Status & tagging log