Posted by dalin on December 29, 2008 at 11:28am
Jump to:
| Project: | Drupal core |
| Version: | 6.x-dev |
| Component: | base system |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
drupal_build_css_cache() attempts to resolve paths to background images with this statement:
<?php
$data .= preg_replace_callback('/url\([\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\)/i', '_drupal_build_css_path', $contents);
?>This works fine for a shorthand background CSS statement like:background: #00B1D4 url(some/path.jpg) no-repeat;
But not with the following (The match sent into _drupal_build_css_path() is something real ugly):background-image:url(some/path.jpg);
To make it work you need to enclose url() in spaces:background-image: url(some/path.jpg) ;
I don't have the regex chops to be able to know what's going on or how to fix it.
Comments
#1
related issue #444228: Optimize CSS option causes php cgi to segfault in pcre function "match"
#2
#258846: CSS aggregation fails to parse some url()'s