* (bug 35446) Using "{{nse:}}" with an invalid namespace name no longer throws a...
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Mon, 26 Mar 2012 18:26:32 +0000 (20:26 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Mon, 26 Mar 2012 18:27:18 +0000 (20:27 +0200)
Change-Id: I8e7611cdb03558af13ec5b96e02857ff5b16b571

HISTORY
includes/parser/CoreParserFunctions.php

diff --git a/HISTORY b/HISTORY
index 14a80d0..e138ec0 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,10 @@
 Change notes from older releases. For current info see RELEASE-NOTES-1.20.
 
 == MediaWiki 1.18 ==
+=== Changes since 1.18.2 ===
+* (bug 35446) Using "{{nse:}}" with an invalid namespace name no longer throws
+  a PHP warning.
+
 === Changes since 1.18.1 ===
 
 * (bug 33686) could not get a list of contributor for an article when using
index 0abfcef..7614bf5 100644 (file)
@@ -141,7 +141,11 @@ class CoreParserFunctions {
        }
 
        static function nse( $parser, $part1 = '' ) {
-               return wfUrlencode( str_replace( ' ', '_', self::ns( $parser, $part1 ) ) );
+               $ret = self::ns( $parser, $part1 );
+               if ( is_string( $ret ) ) {
+                       $ret = wfUrlencode( str_replace( ' ', '_', $ret ) );
+               }
+               return $ret;
        }
 
        /**