@@ -163,32 +163,32 @@ discard block |
||
163 | 163 | // Remove the original style tag |
164 | 164 | $this->content = str_replace($tag,'',$this->content); |
165 | 165 | } else { |
166 | - // excluded CSS, minify if getpath |
|
167 | - if (preg_match('#<link.*href=("|\')(.*)("|\')#Usmi',$tag,$source)) { |
|
168 | - $explUrl = explode('?',$source[2],2); |
|
166 | + // excluded CSS, minify if getpath |
|
167 | + if (preg_match('#<link.*href=("|\')(.*)("|\')#Usmi',$tag,$source)) { |
|
168 | + $explUrl = explode('?',$source[2],2); |
|
169 | 169 | $url = $explUrl[0]; |
170 | 170 | $path = $this->getpath($url); |
171 | 171 | |
172 | - if ($path && apply_filters('autoptimize_filter_css_minify_excluded',false)) { |
|
173 | - $_CachedMinifiedUrl = $this->minify_single($path); |
|
174 | - |
|
175 | - if (!empty($_CachedMinifiedUrl)) { |
|
176 | - // replace orig URL with URL to cache |
|
177 | - $newTag = str_replace($url, $_CachedMinifiedUrl, $tag); |
|
178 | - } else { |
|
179 | - $newTag = $tag; |
|
180 | - } |
|
172 | + if ($path && apply_filters('autoptimize_filter_css_minify_excluded',false)) { |
|
173 | + $_CachedMinifiedUrl = $this->minify_single($path); |
|
174 | + |
|
175 | + if (!empty($_CachedMinifiedUrl)) { |
|
176 | + // replace orig URL with URL to cache |
|
177 | + $newTag = str_replace($url, $_CachedMinifiedUrl, $tag); |
|
178 | + } else { |
|
179 | + $newTag = $tag; |
|
180 | + } |
|
181 | 181 | |
182 | - // remove querystring from URL |
|
183 | - if ( !empty($explUrl[1]) ) { |
|
184 | - $newTag = str_replace("?".$explUrl[1],"",$newTag); |
|
185 | - } |
|
186 | - |
|
187 | - // and replace |
|
188 | - $this->content = str_replace($tag,$newTag,$this->content); |
|
189 | - } |
|
190 | - } |
|
191 | - } |
|
182 | + // remove querystring from URL |
|
183 | + if ( !empty($explUrl[1]) ) { |
|
184 | + $newTag = str_replace("?".$explUrl[1],"",$newTag); |
|
185 | + } |
|
186 | + |
|
187 | + // and replace |
|
188 | + $this->content = str_replace($tag,$newTag,$this->content); |
|
189 | + } |
|
190 | + } |
|
191 | + } |
|
192 | 192 | } |
193 | 193 | return true; |
194 | 194 | } |
@@ -661,8 +661,8 @@ discard block |
||
661 | 661 | } |
662 | 662 | |
663 | 663 | private function ismovable($tag) { |
664 | - if (apply_filters('autoptimize_filter_css_dontaggregate',false)) { |
|
665 | - return false; |
|
664 | + if (apply_filters('autoptimize_filter_css_dontaggregate',false)) { |
|
665 | + return false; |
|
666 | 666 | } else if (!empty($this->whitelist)) { |
667 | 667 | foreach ($this->whitelist as $match) { |
668 | 668 | if(strpos($tag,$match)!==false) { |