X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fparser%2FCoreParserFunctions.php;h=d408c7fffb5f8e6821f0a1a0c131d38131892425;hb=a3cb61b90537f123737870fca5a6b92b79e65c37;hp=07944d464896468eafd8f4d3a9d3b1e12d0639a0;hpb=64a6afaf6964b3f9e61d595d5586fe7428a57e73;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 07944d4648..d408c7fffb 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -337,8 +337,8 @@ class CoreParserFunctions { // default $gender = User::getDefaultOption( 'gender' ); - // allow prefix. - $title = Title::newFromText( $username ); + // allow prefix and normalize (e.g. "*foo" -> "*foo" ). + $title = Title::newFromText( $username, NS_USER ); if ( $title && $title->inNamespace( NS_USER ) ) { $username = $title->getText(); @@ -830,7 +830,7 @@ class CoreParserFunctions { $restrictions = $titleObject->getRestrictions( strtolower( $type ) ); # Title::getRestrictions returns an array, its possible it may have # multiple values in the future - return implode( $restrictions, ',' ); + return implode( ',', $restrictions ); } return ''; } @@ -1005,10 +1005,10 @@ class CoreParserFunctions { if ( $argA == 'nowiki' ) { // {{filepath: | option [| size] }} $isNowiki = true; - $parsedWidthParam = $parser->parseWidthParam( $argB ); + $parsedWidthParam = Parser::parseWidthParam( $argB ); } else { // {{filepath: [| size [|option]] }} - $parsedWidthParam = $parser->parseWidthParam( $argA ); + $parsedWidthParam = Parser::parseWidthParam( $argA ); $isNowiki = ( $argB == 'nowiki' ); } @@ -1339,7 +1339,7 @@ class CoreParserFunctions { foreach ( $sources[0] as $sourceTitle ) { $names[] = $sourceTitle->getPrefixedText(); } - return implode( $names, '|' ); + return implode( '|', $names ); } return ''; }