| @@ 218-223 (lines=6) @@ | ||
| 215 | $css = $this->fixurls($cssPath,file_get_contents($cssPath)); |
|
| 216 | $css = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$css);
|
|
| 217 | $tmpstyle = apply_filters( 'autoptimize_css_individual_style', $css, $cssPath ); |
|
| 218 | if (has_filter('autoptimize_css_individual_style') && !empty($tmpstyle)) {
|
|
| 219 | $css=$tmpstyle; |
|
| 220 | $this->alreadyminified=true; |
|
| 221 | } else if ($this->can_inject_late($cssPath,$css)) {
|
|
| 222 | $css="/*!%%INJECTLATER%%".base64_encode($cssPath)."|".md5($css)."%%INJECTLATER%%*/"; |
|
| 223 | } |
|
| 224 | } else {
|
|
| 225 | // Couldn't read CSS. Maybe getpath isn't working? |
|
| 226 | $css = ''; |
|
| @@ 280-285 (lines=6) @@ | ||
| 277 | $code = addcslashes($this->fixurls($path,file_get_contents($path)),"\\"); |
|
| 278 | $code = preg_replace('/\x{EF}\x{BB}\x{BF}/','',$code);
|
|
| 279 | $tmpstyle = apply_filters( 'autoptimize_css_individual_style', $code, "" ); |
|
| 280 | if ( has_filter('autoptimize_css_individual_style') && !empty($tmpstyle)) {
|
|
| 281 | $code=$tmpstyle; |
|
| 282 | $this->alreadyminified=true; |
|
| 283 | } else if ($this->can_inject_late($path,$code)) {
|
|
| 284 | $code="/*!%%INJECTLATER%%".base64_encode($path)."|".md5($code)."%%INJECTLATER%%*/"; |
|
| 285 | } |
|
| 286 | ||
| 287 | if(!empty($code)) {
|
|
| 288 | $tmp_thiscss = preg_replace('#(/\*FILESTART\*/.*)'.preg_quote($import,'#').'#Us','/*FILESTART2*/'.$code.'$1',$thiscss);
|
|
| @@ 240-245 (lines=6) @@ | ||
| 237 | $scriptsrc = 'try{'.$scriptsrc.'}catch(e){}'; |
|
| 238 | } |
|
| 239 | $tmpscriptsrc = apply_filters( 'autoptimize_js_individual_script', $scriptsrc, $script ); |
|
| 240 | if ( has_filter('autoptimize_js_individual_script') && !empty($tmpscriptsrc) ) { |
|
| 241 | $scriptsrc=$tmpscriptsrc; |
|
| 242 | $this->alreadyminified=true; |
|
| 243 | } else if ($this->can_inject_late($script)) { |
|
| 244 | $scriptsrc="/*!%%INJECTLATER%%".base64_encode($script)."|".md5($scriptsrc)."%%INJECTLATER%%*/"; |
|
| 245 | } |
|
| 246 | $this->jscode .= "\n".$scriptsrc; |
|
| 247 | }/*else{ |
|
| 248 | //Couldn't read JS. Maybe getpath isn't working? |
|