r79130 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79129‎ | r79130 | r79131 >
Date:20:00, 28 December 2010
Author:platonides
Status:reverted
Tags:
Comment:
MFT r79122 + RELEASE-NOTES
Modified paths:
  • /branches/REL1_17/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_17/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/includes/Article.php
@@ -41,7 +41,7 @@
4242 var $mTouched = '19700101000000'; // !<
4343 var $mUser = -1; // !< Not loaded
4444 var $mUserText = ''; // !< username from Revision if set
45 - var $mParserOptions; // !< ParserOptions object
 45+ var $mParserOptions; // !< ParserOptions object for $wgUser articles
4646 var $mParserOutput; // !< ParserCache object if set
4747 /**@}}*/
4848
@@ -3593,7 +3593,7 @@
35943594 $edit->revid = $revid;
35953595 $edit->newText = $text;
35963596 $edit->pst = $this->preSaveTransform( $text );
3597 - $edit->popts = $this->getParserOptions();
 3597+ $edit->popts = $this->getParserOptions( true );
35983598 $edit->output = $wgParser->parse( $edit->pst, $this->mTitle, $edit->popts, true, true, $revid );
35993599 $edit->oldText = $this->getContent();
36003600
@@ -4434,15 +4434,23 @@
44354435
44364436 /**
44374437 * Get parser options suitable for rendering the primary article wikitext
 4438+ * @param $canonical boolean Determines that the generated must not depend on user preferences (see bug 14404)
44384439 * @return mixed ParserOptions object or boolean false
44394440 */
4440 - public function getParserOptions() {
4441 - global $wgUser;
 4441+ public function getParserOptions( $canonical = false ) {
 4442+ global $wgUser, $wgLanguageCode;
44424443
4443 - if ( !$this->mParserOptions ) {
4444 - $this->mParserOptions = new ParserOptions( $wgUser );
4445 - $this->mParserOptions->setTidy( true );
4446 - $this->mParserOptions->enableLimitReport();
 4444+ if ( !$this->mParserOptions || $canonical ) {
 4445+ $user = !$canonical ? $wgUser : new User;
 4446+ $parserOptions = new ParserOptions( $user );
 4447+ $parserOptions->setTidy( true );
 4448+ $parserOptions->enableLimitReport();
 4449+
 4450+ if ( $canonical ) {
 4451+ $parserOptions->setUserLang( $wgLanguageCode ); # Must be set explicitely
 4452+ return $parserOptions;
 4453+ }
 4454+ $this->mParserOptions = $parserOptions;
44474455 }
44484456
44494457 // Clone to allow modifications of the return value without affecting
Index: branches/REL1_17/phase3/RELEASE-NOTES
@@ -474,6 +474,9 @@
475475 as wikitext on preview.
476476 * Page existence is now not revealed (in the colour of the tabs) to users who cannot
477477 read the page in question.
 478+* (bug 14404) The articles are now always saved with the default options. Articles
 479+ with {{int:X}} will have consistent table links no matter the preferences of the
 480+ last saving user.
478481
479482 === API changes in 1.17 ===
480483 * BREAKING CHANGE: action=patrol now requires POST

Follow-up revisions

RevisionCommit summaryAuthorDate
r83869Revert r79130, equivalent to trunk r83868: use the same cache before and afte...tstarling04:29, 14 March 2011
r83870Revert r79130, equivalent to trunk r83868: use the same cache before and afte...tstarling04:31, 14 March 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r79122Fix bug 14404. The articles are now always saved with the default options....platonides18:44, 28 December 2010

Status & tagging log