Merge "MimeAnalyzer: Add testcases for mp3 detection"
[lhc/web/wiklou.git] / includes / parser / CoreParserFunctions.php
index 51cb410..f0f1f5f 100644 (file)
@@ -157,7 +157,7 @@ class CoreParserFunctions {
        }
 
        /**
-        * urlencodes a string according to one of three patterns: (bug 22474)
+        * urlencodes a string according to one of three patterns: (T24474)
         *
         * By default (for HTTP "query" strings), spaces are encoded as '+'.
         * Or to encode a value for the HTTP "path", spaces are encoded as '%20'.
@@ -174,7 +174,6 @@ class CoreParserFunctions {
                        $magicWords = new MagicWordArray( [ 'url_path', 'url_query', 'url_wiki' ] );
                }
                switch ( $magicWords->matchStartToEnd( $arg ) ) {
-
                        // Encode as though it's a wiki page, '_' for ' '.
                        case 'url_wiki':
                                $func = 'wfUrlencode';
@@ -276,7 +275,7 @@ class CoreParserFunctions {
                }
                if ( !is_null( $title ) ) {
                        # Convert NS_MEDIA -> NS_FILE
-                       if ( $title->getNamespace() == NS_MEDIA ) {
+                       if ( $title->inNamespace( NS_MEDIA ) ) {
                                $title = Title::makeTitle( NS_FILE, $title->getDBkey() );
                        }
                        if ( !is_null( $arg ) ) {
@@ -341,7 +340,7 @@ class CoreParserFunctions {
                // allow prefix.
                $title = Title::newFromText( $username );
 
-               if ( $title && $title->getNamespace() == NS_USER ) {
+               if ( $title && $title->inNamespace( NS_USER ) ) {
                        $username = $title->getText();
                }