X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FLinker.php;h=d6a4056f02622e37009970e4058bbb89d71ddfe7;hb=e66ee985e0792d2c28ebb0d5b299af5bce87eb9b;hp=4a1aa872d8bc9b78ba5b3a9c694c245fb050df5c;hpb=8195fd3551c484cfe140fd54ac9c16c2d8c4bc4a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Linker.php b/includes/Linker.php index 4a1aa872d8..d6a4056f02 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -77,7 +77,7 @@ class Linker { wfDeprecated( __METHOD__, '1.25' ); $title = urldecode( $title ); - $title = str_replace( '_', ' ', $title ); + $title = strtr( $title, '_', ' ' ); return self::getLinkAttributesInternal( $title, $class ); } @@ -1414,10 +1414,9 @@ class Linker { # fix up urlencoded title texts (copied from Parser::replaceInternalLinks) if ( strpos( $match[1], '%' ) !== false ) { - $match[1] = str_replace( - array( '<', '>' ), - array( '<', '>' ), - rawurldecode( $match[1] ) + $match[1] = strtr( + rawurldecode( $match[1] ), + array( '<' => '<', '>' => '>' ) ); } @@ -1705,8 +1704,7 @@ class Linker { } /** - * Generate a table of contents from a section tree - * Currently unused. + * Generate a table of contents from a section tree. * * @param array $tree Return value of ParserOutput::getSections() * @param string|Language|bool $lang Language for the toc title, defaults to user language