From a3aac44f0481fb635877f161b8208ba830e83a78 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Sat, 10 Jul 2010 11:30:11 +0000 Subject: [PATCH] (bug 14685) Double underscore magic word usage is now tracked in the page_props table, as well as the behavioral magic words {{DEFAULTSORT}} and {{DISPLAYTITLE}}. --- RELEASE-NOTES | 3 +++ includes/parser/Parser.php | 7 ++++++- includes/parser/ParserOutput.php | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d0d734e9e4..951f7187ea 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -106,6 +106,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * ForeignApiRepo uses scriptDirUrl if apiBase not set * (bug 24212) Added MediaWiki:Filepage.css which is also included on foreign client wikis. +* (bug 14685) Double underscore magic word usage is now tracked in the + page_props table, as well as the behavioral magic words {{DEFAULTSORT}} and + {{DISPLAYTITLE}} === Bug fixes in 1.17 === * (bug 17560) Half-broken deletion moved image files to deletion archive diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 9ee2499de8..400029fedf 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3634,7 +3634,6 @@ class Parser { $this->mShowToc = false; } if ( isset( $this->mDoubleUnderscores['hiddencat'] ) && $this->mTitle->getNamespace() == NS_CATEGORY ) { - $this->mOutput->setProperty( 'hiddencat', 'y' ); $this->addTrackingCategory( 'hidden-category-category' ); } # (bug 8068) Allow control over whether robots index a page. @@ -3649,6 +3648,11 @@ class Parser { $this->mOutput->setIndexPolicy( 'index' ); $this->addTrackingCategory( 'index-category' ); } + + # Cache all double underscores in the database + foreach ( $this->mDoubleUnderscores as $key => $val ) { + $this->mOutput->setProperty( $key, '' ); + } wfProfileOut( __METHOD__ ); return $text; @@ -5137,6 +5141,7 @@ class Parser { */ public function setDefaultSort( $sort ) { $this->mDefaultSort = $sort; + $this->mOutput->setPropert( 'defaultsort', $sort ); } /** diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 1f390a26e8..cc11049400 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -259,6 +259,7 @@ class ParserOutput */ public function setDisplayTitle( $text ) { $this->setTitleText( $text ); + $this->setProperty( 'displaytitle', $text ); } /** -- 2.20.1