Skip to content

Commit

Permalink
Ignore urls with protocols in CSS.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cody Lundquist committed Mar 14, 2015
1 parent 7d71999 commit 9e015ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Munee/Asset/Type/Css.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ protected function fixRelativeImagePaths($content, $originalFile)
$changedContent = preg_replace_callback($regEx, function ($match) use ($originalFile, $webroot) {
$filePath = trim($match[2]);
// Skip conversion if the first character is a '/' since it's already an absolute path
if ($filePath[0] !== '/') {
// Also skip conversion if the string has an protocol in url
if ($filePath[0] !== '/' && strpos($filePath, '://') === false) {
$basePath = SUB_FOLDER . str_replace($webroot, '', dirname($originalFile));
$basePathParts = array_reverse(array_filter(explode('/', $basePath)));
$numOfRecursiveDirs = substr_count($filePath, '../');
Expand Down

0 comments on commit 9e015ce

Please sign in to comment.