Download & Extend

drupal_build_css_cache() cannot deal with a url() statement not surrounded by spaces.

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

#2

Status:active» closed (duplicate)

#258846: CSS aggregation fails to parse some url()'s

nobody click here