aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2013-12-06 17:18:19 +0000
committermistic100 <mistic@piwigo.org>2013-12-06 17:18:19 +0000
commit1e69be0b7a47c84b09a52266115ec7fd53d9376e (patch)
tree0b38ffa35a6f8612d6a77cf075fd131e3a6d9172 /include
parentca8e0928e3d68e78b4829f2e788ddca3555c33d8 (diff)
FileCombiner does not try to change url of images embedded in base64
git-svn-id: http://piwigo.org/svn/trunk@25800 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/template.class.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/template.class.php b/include/template.class.php
index 56ef8cb60..733d051ff 100644
--- a/include/template.class.php
+++ b/include/template.class.php
@@ -1537,14 +1537,15 @@ final class FileCombiner
private static function process_css_rec($css, $dir)
{
- static $PATTERN = "#url\(\s*['|\"]{0,1}(.*?)['|\"]{0,1}\s*\)#";
+ static $PATTERN_URL = "#url\(\s*['|\"]{0,1}(.*?)['|\"]{0,1}\s*\)#";
+ static $PATTERN_IMPORT = "#@import\s*['|\"]{0,1}(.*?)['|\"]{0,1};#";
- if (preg_match_all($PATTERN, $css, $matches, PREG_SET_ORDER))
+ if (preg_match_all($PATTERN_URL, $css, $matches, PREG_SET_ORDER))
{
$search = $replace = array();
foreach ($matches as $match)
{
- if ( !url_is_remote($match[1]) && $match[1][0] != '/')
+ if ( !url_is_remote($match[1]) && $match[1][0] != '/' && strpos($match[1], 'data:image/')===false)
{
$relative = $dir . "/$match[1]";
$search[] = $match[0];
@@ -1554,8 +1555,7 @@ final class FileCombiner
$css = str_replace($search, $replace, $css);
}
- $imports = preg_match_all("#@import\s*['|\"]{0,1}(.*?)['|\"]{0,1};#", $css, $matches, PREG_SET_ORDER);
- if ($imports)
+ if (preg_match_all($PATTERN_IMPORT, $css, $matches, PREG_SET_ORDER))
{
$search = $replace = array();
foreach ($matches as $match)