X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2FCSSMin.php;h=bc99672f36301fad648f0d46ec98d121ed6660ee;hb=34fe90ac52644c3a543ca8adf89900c0fb2de70b;hp=ece29e85ccb73c265fbb9220bc3be1d6c6c7e147;hpb=734ca2b4d2a1246fb0ea1e54b861ab423ab5e257;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index ece29e85cc..bc99672f36 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -60,41 +60,13 @@ class CSSMin { /* Static Methods */ /** - * Gets a list of local file paths which are referenced in a CSS style sheet. - * - * If you wish non-existent files to be listed too, use getAllLocalFileReferences(). - * - * For backwards-compatibility, if the second parameter is not given or null, - * this function will return an empty array instead of erroring out. - * - * @param string $source CSS stylesheet source to process - * @param string $path File path where the source was read from - * @return array List of local file references - */ - public static function getLocalFileReferences( $source, $path = null ) { - if ( $path === null ) { - return []; - } - - $files = self::getAllLocalFileReferences( $source, $path ); - - // Skip non-existent files - $files = array_filter( $files, function ( $file ) { - return file_exists( $file ); - } ); - - return $files; - } - - /** - * Gets a list of local file paths which are referenced in a CSS style sheet, including - * non-existent files. + * Get a list of local files referenced in a stylesheet (includes non-existent files). * * @param string $source CSS stylesheet source to process * @param string $path File path where the source was read from * @return array List of local file references */ - public static function getAllLocalFileReferences( $source, $path ) { + public static function getLocalFileReferences( $source, $path ) { $stripped = preg_replace( '/' . self::COMMENT_REGEX . '/s', '', $source ); $path = rtrim( $path, '/' ) . '/'; $files = []; @@ -200,7 +172,7 @@ class CSSMin { } /** - * @param $file string + * @param string $file * @return bool|string */ public static function getMimeType( $file ) { @@ -347,7 +319,7 @@ class CSSMin { ); $url = $match['file'] . $match['query']; - $file = $local . $match['file']; + $file = "{$local}/{$match['file']}"; if ( !self::isRemoteUrl( $url ) && !self::isLocalUrl( $url ) && file_exists( $file ) @@ -385,7 +357,6 @@ class CSSMin { }, $source ); return $source; - } /**