From 9dc2e7f68391f19f92a59098356d13176762bff7 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Wed, 17 May 2006 14:41:51 +0000 Subject: [PATCH] (bug 6001) PAGENAMEE and FULLPAGENAMEE don't work in FULLURL and LOCALURL magic words --- RELEASE-NOTES | 2 ++ includes/Parser.php | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e7b3cfcdbf..0ab7cf6c15 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/Parser.php b/includes/Parser.php index 251e32a2ab..f3eb35aeeb 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -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] ); -- 2.20.1