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
This commit is contained in:
Jb Audras 2022-01-14 11:00:35 +00:00
parent ea1fe31f02
commit 8631739e5d

View File

@ -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;
}