Changeset 25800


Ignore:
Timestamp:
Dec 6, 2013, 6:18:19 PM (7 years ago)
Author:
mistic100
Message:

FileCombiner does not try to change url of images embedded in base64

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/template.class.php

    r25568 r25800  
    15381538  private static function process_css_rec($css, $dir)
    15391539  {
    1540     static $PATTERN = "#url\(\s*['|\"]{0,1}(.*?)['|\"]{0,1}\s*\)#";
    1541 
    1542     if (preg_match_all($PATTERN, $css, $matches, PREG_SET_ORDER))
     1540    static $PATTERN_URL = "#url\(\s*['|\"]{0,1}(.*?)['|\"]{0,1}\s*\)#";
     1541    static $PATTERN_IMPORT = "#@import\s*['|\"]{0,1}(.*?)['|\"]{0,1};#";
     1542
     1543    if (preg_match_all($PATTERN_URL, $css, $matches, PREG_SET_ORDER))
    15431544    {
    15441545      $search = $replace = array();
    15451546      foreach ($matches as $match)
    15461547      {
    1547         if ( !url_is_remote($match[1]) && $match[1][0] != '/')
     1548        if ( !url_is_remote($match[1]) && $match[1][0] != '/' && strpos($match[1], 'data:image/')===false)
    15481549        {
    15491550          $relative = $dir . "/$match[1]";
     
    15551556    }
    15561557
    1557     $imports = preg_match_all("#@import\s*['|\"]{0,1}(.*?)['|\"]{0,1};#", $css, $matches, PREG_SET_ORDER);
    1558     if ($imports)
     1558    if (preg_match_all($PATTERN_IMPORT, $css, $matches, PREG_SET_ORDER))
    15591559    {
    15601560      $search = $replace = array();
Note: See TracChangeset for help on using the changeset viewer.