$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;
}
// 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;
}
* @author Timo Tijhof
*/
+/**
+ * @group ResourceLoader
+ * @group CSSMin
+ */
class CSSMinTest extends MediaWikiTestCase {
protected function setUp() {
[ 'foo { prop: url(/w/skin/images/bar.png); }', false, 'http://example.org/quux', false ],
'foo { prop: url(http://doc.example.org/w/skin/images/bar.png); }',
],
+ [
+ "Don't barf at behavior: url(#default#behaviorName) - T162973",
+ [ 'foo { behavior: url(#default#bar); }', false, '/w/', false ],
+ 'foo { behavior: url("#default#bar"); }',
+ ],
];
}