From 8631739e5d7c373af9b3fe305bf20c5af481d1a8 Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Fri, 14 Jan 2022 11:00:35 +0000 Subject: [PATCH] Media: Add a missing `/` in post thumbnail lazy loading regex. This change avoids a warning thrown by a missing slash in a post thumbnail lazyload related regular expression. Follow-up to [52065]. Props SierraTR, audrasjb, costdev. Fixes #54815. git-svn-id: https://develop.svn.wordpress.org/trunk@52574 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post-thumbnail-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/post-thumbnail-template.php b/src/wp-includes/post-thumbnail-template.php index 091ffe4811..58315bc60f 100644 --- a/src/wp-includes/post-thumbnail-template.php +++ b/src/wp-includes/post-thumbnail-template.php @@ -195,7 +195,7 @@ function get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr = $attr = array( 'loading' => $loading ); } elseif ( is_array( $attr ) && ! array_key_exists( 'loading', $attr ) ) { $attr['loading'] = $loading; - } elseif ( is_string( $attr ) && ! preg_match( '/(^|&)loading=', $attr ) ) { + } elseif ( is_string( $attr ) && ! preg_match( '/(^|&)loading=/', $attr ) ) { $attr .= '&loading=' . $loading; }