// is only supported in PHP 5.6. Use a getter method for now.
$urlRegex = '(' .
// Unquoted url
- 'url\(\s*(?P<file0>[^\'"][^\?\)]+?)(?P<query0>\?[^\)]*?|)\s*\)' .
+ 'url\(\s*(?P<file0>[^\s\'"][^\?\)]+?)(?P<query0>\?[^\)]*?|)\s*\)' .
// Single quoted url
'|url\(\s*\'(?P<file1>[^\?\']+?)(?P<query1>\?[^\']*?|)\'\s*\)' .
// Double quoted url
'foo { background: url(//localhost/styles.css?quoted=single) }',
],
[
- 'Background URL (containing parentheses; T60473)',
+ 'Background URL (double quoted, containing parentheses; T60473)',
'foo { background: url("//localhost/styles.css?query=(parens)") }',
'foo { background: url("//localhost/styles.css?query=(parens)") }',
],
'foo { background: url(\'//localhost/styles.css?quote="\') }',
'foo { background: url("//localhost/styles.css?quote=\"") }',
],
+ [
+ 'Background URL (double quoted with outer spacing)',
+ 'foo { background: url( "http://localhost/styles.css?quoted=double" ) }',
+ 'foo { background: url(http://localhost/styles.css?quoted=double) }',
+ ],
[
'Simple case with comments before url',
'foo { prop: /* some {funny;} comment */ url(bar.png); }',