Merge "Use strtr() for clarity"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 14 Jun 2017 20:18:58 +0000 (20:18 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 14 Jun 2017 20:18:59 +0000 (20:18 +0000)
includes/Sanitizer.php

index 5aaa3ed..8920e92 100644 (file)
@@ -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!