[BUGFIX] t3lib_Compressor breaks absolute paths in CSS
authorAndreas Bouche <bouche@flagbit.de>
Tue, 20 Sep 2011 13:45:57 +0000 (15:45 +0200)
committerDmitry Dulepov <dmitry@typo3.org>
Wed, 5 Oct 2011 13:28:34 +0000 (15:28 +0200)
Adds a negative lookahead for trailing slash to the regular
Expressions in method "cssFixRelativeUrlPaths" to exclude
absolute paths from being rewritten.

Change-Id: I4f306e314cab748a24d3e25fcb9a86a28e12384a
Resolves: #29904
Releases: 4.5
Reviewed-on: http://review.typo3.org/5123
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
t3lib/class.t3lib_compressor.php

index 2cfc77d..8c207cd 100644 (file)
@@ -376,7 +376,7 @@ class t3lib_Compressor {
        protected function cssFixRelativeUrlPaths($contents, $oldDir) {
                $matches = array();
 
-               preg_match_all('/url(\(\s*["\']?([^"\']+)["\']?\s*\))/iU', $contents, $matches);
+               preg_match_all('/url(\(\s*["\']?(?!\/)([^"\']+)["\']?\s*\))/iU', $contents, $matches);
                foreach ($matches[2] as $matchCount => $match) {
                                // remove '," or white-spaces around
                        $match = preg_replace('/[\"\'\s]/', '', $match);