Code Duplication    Length = 3-9 lines in 2 locations

classes/autoptimizeScripts.php 1 location

@@ 364-372 (lines=9) @@
361
                            } else {
362
                                $this->move['first'][] = $new_tag;
363
                            }
364
                        } else {
365
                            // cannot be moved, so if flag was added re-inject altered tag immediately.
366
                            if ( ( '' !== $new_tag && $orig_tag !== $new_tag ) || ( '' === $new_tag && apply_filters( 'autoptimize_filter_js_remove_empty_files', false ) ) ) {
367
                                $this->content = str_replace( $orig_tag, $new_tag, $this->content );
368
                                $orig_tag      = '';
369
                            }
370
                            // and forget about the $tag (not to be touched any more).
371
                            $tag = '';
372
                        }
373
                    }
374
                } else {
375
                    // Inline script.

classes/autoptimizeStyles.php 1 location

@@ 361-363 (lines=3) @@
358
                        }
359
360
                        // And replace!
361
                        if ( ( '' !== $new_tag && $new_tag !== $tag ) || ( '' === $new_tag && apply_filters( 'autoptimize_filter_css_remove_empty_files', false ) ) ) {
362
                            $this->content = str_replace( $tag, $new_tag, $this->content );
363
                        }
364
                    }
365
                }
366
            }