X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Ffilerepo%2Ffile%2FFile.php;h=f40d216c58da556d4a1a89c705764d405bef02e7;hp=3677a14b9786fa8f9a76ac588e897cacc471f59f;hb=55a49465334a23df2c79672b733de83962c47296;hpb=4b360b81060480404c00b89d254727c9980ac874 diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 3677a14b97..f40d216c58 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -213,14 +213,15 @@ abstract class File implements IDBAccessObject { } /** - * Normalize a file extension to the common form, and ensure it's clean. - * Extensions with non-alphanumeric characters will be discarded. + * Normalize a file extension to the common form, making it lowercase and checking some synonyms, + * and ensure it's clean. Extensions with non-alphanumeric characters will be discarded. + * Keep in sync with mw.Title.normalizeExtension() in JS. * - * @param string $ext (without the .) - * @return string + * @param string $extension File extension (without the leading dot) + * @return string File extension in canonical form */ - static function normalizeExtension( $ext ) { - $lower = strtolower( $ext ); + static function normalizeExtension( $extension ) { + $lower = strtolower( $extension ); $squish = array( 'htm' => 'html', 'jpeg' => 'jpg',