diff --git a/inc/manager.php b/inc/manager.php index 3483ce42..359b61a1 100644 --- a/inc/manager.php +++ b/inc/manager.php @@ -435,7 +435,7 @@ public static function parse_images_from_html( $content ) { $header_end = $header_start + strlen( $matches[0][0] ); } - if ( preg_match_all( '/(?:]+?href=["|\'](?P[^\s]+?)["|\'][^>]*?>\s*)?(?P(?:\s*)?]*?\s+?(?:' . implode( '|', array_merge( [ 'src' ], Optml_Tag_Replacer::possible_src_attributes() ) ) . ')=\\\\?["|\'](?P[^\s]+?)["|\'].*?>(?:<\/noscript\s*>)?){1}(?:\s*<\/a>)?/ism', $content, $images, PREG_OFFSET_CAPTURE ) ) { + if ( preg_match_all( '/(?:]+?href=["|\'](?P[^\s]+?)["|\'][^>]*?>\s*)?(?P(?:\s*)?]*?\s+?(?:' . implode( '|', array_merge( [ 'src' ], Optml_Tag_Replacer::possible_src_attributes() ) ) . ')=\\\\?["|\'](?P[^\s]+?)["|\'].*?>(?:\s*<\/noscript\s*>)?){1}(?:\s*<\/a>)?/ism', $content, $images, PREG_OFFSET_CAPTURE ) ) { foreach ( $images as $key => $unused ) { // Simplify the output as much as possible, mostly for confirming test results. diff --git a/tests/test-lazyload.php b/tests/test-lazyload.php index 0debfd01..2acd88a5 100644 --- a/tests/test-lazyload.php +++ b/tests/test-lazyload.php @@ -245,7 +245,11 @@ public function test_check_with_multiple_images_in_no_script() { } public function test_check_lazy_load_after_no_script() { - $content = ' + $content = ' +