function _drupal_build_css_path

Prefixes all paths within a CSS file for drupal_build_css_cache().

2 calls to _drupal_build_css_path()
color_scheme_form_submit in modules/color/color.module
Form submission handler for color_scheme_form().
drupal_build_css_cache in includes/common.inc
Aggregates and optimizes CSS files into a cache file in the files directory.
2 string references to '_drupal_build_css_path'
color_scheme_form_submit in modules/color/color.module
Form submission handler for color_scheme_form().
drupal_build_css_cache in includes/common.inc
Aggregates and optimizes CSS files into a cache file in the files directory.

File

includes/common.inc, line 3799

Code

function _drupal_build_css_path($matches, $base = NULL) {
    $_base =& drupal_static(__FUNCTION__);
    // Store base path for preg_replace_callback.
    if (isset($base)) {
        $_base = $base;
    }
    // Prefix with base and remove '../' segments where possible.
    $path = $_base . (isset($matches[1]) ? $matches[1] : '');
    $last = '';
    while ($path != $last) {
        $last = $path;
        $path = preg_replace('`(^|/)(?!\\.\\./)([^/]+)/\\.\\./`', '$1', $path);
    }
    return 'url(' . $path . ')';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.