r80094 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80093‎ | r80094 | r80095 >
Date:15:13, 12 January 2011
Author:ialex
Status:ok
Tags:
Comment:
* Use $wgScript for the "action" parameter to not break ugly URLs
* Removed another instance of $wgTitle
Modified paths:
  • /trunk/extensions/Cite/SpecialCite_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Cite/SpecialCite_body.php
@@ -52,17 +52,16 @@
5353 }
5454
5555 function execute() {
56 - global $wgOut, $wgTitle;
 56+ global $wgOut, $wgScript;
5757
5858 $wgOut->addHTML(
59 - Xml::element( 'form',
 59+ Xml::openElement( 'form',
6060 array(
6161 'id' => 'specialcite',
6262 'method' => 'get',
63 - 'action' => $wgTitle->escapeLocalUrl()
64 - ),
65 - null
66 - ) .
 63+ 'action' => $wgScript
 64+ ) ) .
 65+ Html::hidden( 'title', SpecialPage::getTitleFor( 'Cite' )->getPrefixedDBkey() ) .
6766 Xml::openElement( 'label' ) .
6867 wfMsgHtml( 'cite_page' ) . ' ' .
6968 Xml::element( 'input',
@@ -91,7 +90,7 @@
9291
9392 class CiteOutput {
9493 var $mTitle, $mArticle, $mId;
95 - var $mParser, $mParserOptions;
 94+ var $mParser, $mParserOptions, $mSpTitle;
9695
9796 function __construct( &$title, &$article, $id ) {
9897 global $wgHooks, $wgParser;
@@ -131,13 +130,12 @@
132131
133132 function genParser() {
134133 $this->mParser = new Parser;
 134+ $this->mSpTitle = SpecialPage::getTitleFor( 'Cite' );
135135 }
136136
137137 function CiteParse( $in, $argv ) {
138 - global $wgTitle;
 138+ $ret = $this->mParser->parse( $in, $this->mSpTitle, $this->mParserOptions, false );
139139
140 - $ret = $this->mParser->parse( $in, $wgTitle, $this->mParserOptions, false );
141 -
142140 return $ret->getText();
143141 }
144142

Status & tagging log