MediaWiki r39552 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r39551‎ | r39552 (on ViewVC)‎ | r39553 >
Date:21:08, 17 August 2008
Author:daniel
Status:old
Tags:
Comment:
add new option $wgRestrictDisplayTitle
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/parser/CoreParserFunctions.php
===================================================================
--- trunk/phase3/includes/parser/CoreParserFunctions.php	(revision 39551)
+++ trunk/phase3/includes/parser/CoreParserFunctions.php	(revision 39552)
@@ -170,10 +170,16 @@
 	 * @return string
 	 */
 	static function displaytitle( $parser, $text = '' ) {
+		global $wgRestrictDisplayTitle;
 		$text = trim( Sanitizer::decodeCharReferences( $text ) );
-		$title = Title::newFromText( $text );
-		if( $title instanceof Title && $title->getFragment() == '' && $title->equals( $parser->mTitle ) )
+
+		if ( !$wgRestrictDisplayTitle ) {
 			$parser->mOutput->setDisplayTitle( $text );
+		} else {
+			$title = Title::newFromText( $text );
+			if( $title instanceof Title && $title->getFragment() == '' && $title->equals( $parser->mTitle ) )
+				$parser->mOutput->setDisplayTitle( $text );
+		}
 		return '';
 	}
 
Index: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php	(revision 39551)
+++ trunk/phase3/includes/DefaultSettings.php	(revision 39552)
@@ -3157,6 +3157,11 @@
 $wgAllowDisplayTitle = true;
 
 /**
+ * for consistency, restrict DISPLAYTITLE to titles that normalize to the same canonical DB key 
+ */
+$wgRestrictDisplayTitle = true;
+
+/**
  * Array of usernames which may not be registered or logged in from
  * Maintenance scripts can still use these
  */
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 39551)
+++ trunk/phase3/RELEASE-NOTES	(revision 39552)
@@ -19,7 +19,9 @@
 it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 
 === Configuration changes in 1.14 ===
-
+* $wgRestrictDisplayTitle controls if the use of the {{DISPLAYTITLE}} magic
+  word is restricted to titles equivalent to the actual page title. This
+  is true per default, but can be set to false to allow any title.
 * $wgExemptFromUserRobotsControl is an array of namespaces to be exempt from
   the effect of the new __INDEX__/__NOINDEX__ magic words.  (Default: null, ex-
   empt all content namespaces.)

Status & tagging log

  • 15:30, 12 September 2011 Meno25 (Talk | contribs) changed the status of r39552 [removed: ok added: old]
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox