(bug 7671) Observe canonical media namespace prefix in Linker::formatComment
[lhc/web/wiklou.git] / includes / Linker.php
index 2a02312..b54c426 100644 (file)
@@ -931,7 +931,8 @@ class Linker {
 
                # format regular and media links - all other wiki formatting
                # is ignored
-               $medians = $wgContLang->getNsText( NS_MEDIA ) . ':';
+               $medians = '(?:' . Namespace::getCanonicalName( NS_MEDIA ) . '|';
+               $medians .= $wgContLang->getNsText( NS_MEDIA ) . '):';
                while(preg_match('/\[\[(.*?)(\|(.*?))*\]\](.*)$/',$comment,$match)) {
                        # Handle link renaming [[foo|text]] will show link as "text"
                        if( "" != $match[3] ) {