Skip to content
Snippets Groups Projects
Commit 0cb873fc authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

@import aufrufe in CSS Dateien ohne url() Funktion werden nun auch anständig proxifiziert.

parent 2451e4fd
No related branches found
No related tags found
1 merge request!3Resolve "CSS-Import-Direktiven"
...@@ -21,6 +21,22 @@ class CssDocument extends Document ...@@ -21,6 +21,22 @@ class CssDocument extends Document
$this->styleString = preg_replace_callback("/(url\()([\"\']{1})([^\\2]+?)\\2/si", "self::pregReplaceUrl", $this->styleString); $this->styleString = preg_replace_callback("/(url\()([\"\']{1})([^\\2]+?)\\2/si", "self::pregReplaceUrl", $this->styleString);
# And then the ones without Quotation Marks # And then the ones without Quotation Marks
$this->styleString = preg_replace_callback("/(url\()([^\"\'][^\)]+?)(\))/si", "self::pregReplaceUrlNoQuotes", $this->styleString); $this->styleString = preg_replace_callback("/(url\()([^\"\'][^\)]+?)(\))/si", "self::pregReplaceUrlNoQuotes", $this->styleString);
# Replace @imports without url()
$this->styleString = preg_replace_callback("/(@import\s+)([\"\'])(.*?)(\\2)/si", "self::pregReplaceImport", $this->styleString);
}
private function pregReplaceImport($matches)
{
$url = $matches[3];
# Relative to Absolute
$url = $this->convertRelativeToAbsoluteLink($url);
# Proxify Url
$url = $this->proxifyUrl($url, false);
$replacement = $matches[1] . $matches[2] . $url . $matches[4];
return $replacement;
} }
private function pregReplaceUrl($matches) private function pregReplaceUrl($matches)
......
source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment