Escape out possible splitter characters within urls

Paramètres

(string) css: Full stylesheet:

1 call to CSSCompression_Trim::escape()
CSSCompression_Trim::trim dans advagg_css_compress/css-compressor-3.x/src/lib/Trim.inc
Central trim handler

Fichier

advagg_css_compress/css-compressor-3.x/src/lib/Trim.inc, line 171

Classe

CSSCompression_Trim
CSS Compressor [VERSION] [DATE] Corey Hart @ <a href="http://www.codenothing.com">http://www.codenothing.com</a>

Code

private function escape($css) {
    foreach ($this->rescape as $regex) {
        $start = 0;
        while (preg_match($regex, $css, $match, PREG_OFFSET_CAPTURE, $start)) {
            $value = $match[1][0] . str_replace($this->escaped['search'], $this->escaped['replace'], $match[2][0]) . $match[3][0];
            $css = substr_replace($css, $value, $match[0][1], strlen($match[0][0]));
            $start = $match[0][1] + strlen($value) + 1;
        }
    }
    return $css;
}