| Index: trunk/phase3/includes/parser/CoreParserFunctions.php |
| — | — | @@ -170,10 +170,16 @@ |
| 171 | 171 | * @return string |
| 172 | 172 | */ |
| 173 | 173 | static function displaytitle( $parser, $text = '' ) { |
| | 174 | + global $wgRestrictDisplayTitle; |
| 174 | 175 | $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 ) { |
| 177 | 178 | $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 | + } |
| 178 | 184 | return ''; |
| 179 | 185 | } |
| 180 | 186 | |
| Index: trunk/phase3/includes/DefaultSettings.php |
| — | — | @@ -3157,6 +3157,11 @@ |
| 3158 | 3158 | $wgAllowDisplayTitle = true; |
| 3159 | 3159 | |
| 3160 | 3160 | /** |
| | 3161 | + * for consistency, restrict DISPLAYTITLE to titles that normalize to the same canonical DB key |
| | 3162 | + */ |
| | 3163 | +$wgRestrictDisplayTitle = true; |
| | 3164 | + |
| | 3165 | +/** |
| 3161 | 3166 | * Array of usernames which may not be registered or logged in from |
| 3162 | 3167 | * Maintenance scripts can still use these |
| 3163 | 3168 | */ |
| Index: trunk/phase3/RELEASE-NOTES |
| — | — | @@ -19,7 +19,9 @@ |
| 20 | 20 | it from source control: http://www.mediawiki.org/wiki/Download_from_SVN |
| 21 | 21 | |
| 22 | 22 | === 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. |
| 24 | 26 | * $wgExemptFromUserRobotsControl is an array of namespaces to be exempt from |
| 25 | 27 | the effect of the new __INDEX__/__NOINDEX__ magic words. (Default: null, ex- |
| 26 | 28 | empt all content namespaces.) |