r39552 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39551‎ | r39552 | r39553 >
Date:21:08, 17 August 2008
Author:daniel
Status:old
Tags:
Comment:
add new option $wgRestrictDisplayTitle
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/parser/CoreParserFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/CoreParserFunctions.php
@@ -170,10 +170,16 @@
171171 * @return string
172172 */
173173 static function displaytitle( $parser, $text = '' ) {
 174+ global $wgRestrictDisplayTitle;
174175 $text = trim( Sanitizer::decodeCharReferences( $text ) );
175 - $title = Title::newFromText( $text );
176 - if( $title instanceof Title && $title->getFragment() == '' && $title->equals( $parser->mTitle ) )
 176+
 177+ if ( !$wgRestrictDisplayTitle ) {
177178 $parser->mOutput->setDisplayTitle( $text );
 179+ } else {
 180+ $title = Title::newFromText( $text );
 181+ if( $title instanceof Title && $title->getFragment() == '' && $title->equals( $parser->mTitle ) )
 182+ $parser->mOutput->setDisplayTitle( $text );
 183+ }
178184 return '';
179185 }
180186
Index: trunk/phase3/includes/DefaultSettings.php
@@ -3157,6 +3157,11 @@
31583158 $wgAllowDisplayTitle = true;
31593159
31603160 /**
 3161+ * for consistency, restrict DISPLAYTITLE to titles that normalize to the same canonical DB key
 3162+ */
 3163+$wgRestrictDisplayTitle = true;
 3164+
 3165+/**
31613166 * Array of usernames which may not be registered or logged in from
31623167 * Maintenance scripts can still use these
31633168 */
Index: trunk/phase3/RELEASE-NOTES
@@ -19,7 +19,9 @@
2020 it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
2121
2222 === Configuration changes in 1.14 ===
23 -
 23+* $wgRestrictDisplayTitle controls if the use of the {{DISPLAYTITLE}} magic
 24+ word is restricted to titles equivalent to the actual page title. This
 25+ is true per default, but can be set to false to allow any title.
2426 * $wgExemptFromUserRobotsControl is an array of namespaces to be exempt from
2527 the effect of the new __INDEX__/__NOINDEX__ magic words. (Default: null, ex-
2628 empt all content namespaces.)

Status & tagging log