X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flibs%2FCSSMin.php;h=9e060cd54a5e31017aed5fba37889ced00d8be2f;hp=c504f3531c7c26e2ce17881fd88757a58462d2e8;hb=4a5f646a7fea7cbe0421c5cf38b72bae5c1bcf65;hpb=aae0c8d42562d5d3f70cc18fa687ae331996b66f diff --git a/includes/libs/CSSMin.php b/includes/libs/CSSMin.php index c504f3531c..9e060cd54a 100644 --- a/includes/libs/CSSMin.php +++ b/includes/libs/CSSMin.php @@ -78,7 +78,12 @@ class CSSMin { $url = $match['file'][0]; // Skip fully-qualified and protocol-relative URLs and data URIs - if ( substr( $url, 0, 2 ) === '//' || parse_url( $url, PHP_URL_SCHEME ) ) { + // Also skips the rare `behavior` property specifying application's default behavior + if ( + substr( $url, 0, 2 ) === '//' || + parse_url( $url, PHP_URL_SCHEME ) || + substr( $url, 0, 9 ) === '#default#' + ) { break; } @@ -252,7 +257,7 @@ class CSSMin { // quotation marks (e.g. "foo /* bar"). $comments = []; - $pattern = '/(?!' . CSSMin::EMBED_REGEX . ')(' . CSSMin::COMMENT_REGEX . ')/s'; + $pattern = '/(?!' . self::EMBED_REGEX . ')(' . self::COMMENT_REGEX . ')/s'; $source = preg_replace_callback( $pattern, @@ -355,8 +360,8 @@ class CSSMin { }, $source ); // Re-insert comments - $pattern = '/' . CSSMin::PLACEHOLDER . '(\d+)x/'; - $source = preg_replace_callback( $pattern, function( $match ) use ( &$comments ) { + $pattern = '/' . self::PLACEHOLDER . '(\d+)x/'; + $source = preg_replace_callback( $pattern, function ( $match ) use ( &$comments ) { return $comments[ $match[1] ]; }, $source ); @@ -474,7 +479,12 @@ class CSSMin { // Pass thru fully-qualified and protocol-relative URLs and data URIs, as well as local URLs if // we can't expand them. - if ( self::isRemoteUrl( $url ) || self::isLocalUrl( $url ) ) { + // Also skips the rare `behavior` property specifying application's default behavior + if ( + self::isRemoteUrl( $url ) || + self::isLocalUrl( $url ) || + substr( $url, 0, 9 ) === '#default#' + ) { return $url; }