From: Max Semenik Date: Tue, 13 Jun 2017 00:01:38 +0000 (-0700) Subject: Use strtr() for clarity X-Git-Tag: 1.31.0-rc.0~2976^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles_versions%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=ffb883f2a9a5ef17feca0411007f0a216c188ed7;p=lhc%2Fweb%2Fwiklou.git Use strtr() for clarity Change-Id: I35e7530c13fee028ea95a56df1bd2714a610db6e --- diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index 5aaa3ed106..8920e92f43 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -1207,7 +1207,7 @@ class Sanitizer { ]; $id = urlencode( strtr( $id, ' ', '_' ) ); - $id = str_replace( array_keys( $replace ), array_values( $replace ), $id ); + $id = strtr( $id, $replace ); if ( !preg_match( '/^[a-zA-Z]/', $id ) && !in_array( 'noninitial', $options ) ) { // Initial character must be a letter!