Code Duplication    Length = 6-6 lines in 3 locations

classes/autoptimizeScripts.php 1 location

@@ 496-501 (lines=6) @@
493
                        $scriptsrc = 'try{' . $scriptsrc . '}catch(e){}';
494
                    }
495
                    $tmpscriptsrc = apply_filters( 'autoptimize_js_individual_script', $scriptsrc, $script );
496
                    if ( has_filter( 'autoptimize_js_individual_script' ) && ! empty( $tmpscriptsrc ) ) {
497
                        $scriptsrc             = $tmpscriptsrc;
498
                        $this->alreadyminified = true;
499
                    } elseif ( $this->can_inject_late( $script ) ) {
500
                        $scriptsrc = self::build_injectlater_marker( $script, md5( $scriptsrc ) );
501
                    }
502
                    $this->jscode .= "\n" . $scriptsrc;
503
                }
504
            }

classes/autoptimizeStyles.php 2 locations

@@ 777-782 (lines=6) @@
774
                    $css      = self::fixurls( $css_path, file_get_contents( $css_path ) );
775
                    $css      = preg_replace( '/\x{EF}\x{BB}\x{BF}/', '', $css );
776
                    $tmpstyle = apply_filters( 'autoptimize_css_individual_style', $css, $css_path );
777
                    if ( has_filter( 'autoptimize_css_individual_style' ) && ! empty( $tmpstyle ) ) {
778
                        $css                   = $tmpstyle;
779
                        $this->alreadyminified = true;
780
                    } elseif ( $this->can_inject_late( $css_path, $css ) ) {
781
                        $css = self::build_injectlater_marker( $css_path, md5( $css ) );
782
                    }
783
                } else {
784
                    // Couldn't read CSS. Maybe getpath isn't working?
785
                    $css = '';
@@ 840-845 (lines=6) @@
837
                            $code     = addcslashes( self::fixurls( $path, file_get_contents( $path ) ), '\\' );
838
                            $code     = preg_replace( '/\x{EF}\x{BB}\x{BF}/', '', $code );
839
                            $tmpstyle = apply_filters( 'autoptimize_css_individual_style', $code, '' );
840
                            if ( has_filter( 'autoptimize_css_individual_style' ) && ! empty( $tmpstyle ) ) {
841
                                $code                  = $tmpstyle;
842
                                $this->alreadyminified = true;
843
                            } elseif ( $this->can_inject_late( $path, $code ) ) {
844
                                $code = self::build_injectlater_marker( $path, md5( $code ) );
845
                            }
846
847
                            if ( ! empty( $code ) ) {
848
                                $tmp_thiscss = preg_replace( '#(/\*FILESTART\*/.*)' . preg_quote( $import, '#' ) . '#Us', '/*FILESTART2*/' . $code . '$1', $thiscss );