X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=blobdiff_plain;f=includes%2Flibs%2FCSSMin.php;h=bba07e263b5c243a1a277b353a803754152c1cbd;hb=c6b1dede111e00d8993c4177c9678d17d035e5ed;hp=bc99672f36301fad648f0d46ec98d121ed6660ee;hpb=72b9240497311a2fa5f5b76d9e8bb953dc59853f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index bc99672f36..bba07e263b 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -8,7 +8,7 @@ * not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS @@ -176,6 +176,12 @@ class CSSMin { * @return bool|string */ public static function getMimeType( $file ) { + // Infer the MIME-type from the file extension + $ext = strtolower( pathinfo( $file, PATHINFO_EXTENSION ) ); + if ( isset( self::$mimeTypes[$ext] ) ) { + return self::$mimeTypes[$ext]; + } + $realpath = realpath( $file ); if ( $realpath @@ -186,12 +192,6 @@ class CSSMin { return finfo_file( finfo_open( FILEINFO_MIME_TYPE ), $realpath ); } - // Infer the MIME-type from the file extension - $ext = strtolower( pathinfo( $file, PATHINFO_EXTENSION ) ); - if ( isset( self::$mimeTypes[$ext] ) ) { - return self::$mimeTypes[$ext]; - } - return false; } @@ -237,7 +237,7 @@ class CSSMin { // * Otherwise remap the URL to work in generated stylesheets // Guard against trailing slashes, because "some/remote/../foo.png" - // resolves to "some/remote/foo.png" on (some?) clients (bug 27052). + // resolves to "some/remote/foo.png" on (some?) clients (T29052). if ( substr( $remote, -1 ) == '/' ) { $remote = substr( $remote, 0, -1 ); }