(bug 6001) PAGENAMEE and FULLPAGENAMEE don't work in FULLURL and LOCALURL magic words
authorRob Church <robchurch@users.mediawiki.org>
Wed, 17 May 2006 14:41:51 +0000 (14:41 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Wed, 17 May 2006 14:41:51 +0000 (14:41 +0000)
RELEASE-NOTES
includes/Parser.php

index e7b3cfc..0ab7cf6 100644 (file)
@@ -283,6 +283,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   for a wiki page; galleries in special pages and categories are unaffected)
 * Maintenance script to remove orphaned revisions from the database
 * (bug 5991) Update for Russian language (ru)
+* (bug 6001) PAGENAMEE and FULLPAGENAMEE don't work in FULLURL and LOCALURL magic
+  words
 
 == Compatibility ==
 
index 251e32a..f3eb35a 100644 (file)
@@ -2622,6 +2622,12 @@ class Parser
 
                        if ( $func !== false ) {
                                $title = Title::newFromText( $part1 );
+                               # Due to order of execution of a lot of bits, the values might be encoded
+                               # before arriving here; if that's true, then the title can't be created
+                               # and the variable will fail. If we can't get a decent title from the first
+                               # attempt, url-decode and try for a second.
+                               if( is_null( $title ) )
+                                       $title = Title::newFromUrl( urldecode( $part1 ) );
                                if ( !is_null( $title ) ) {
                                        if ( $argc > 0 ) {
                                                $text = $linestart . $title->$func( $args[0] );