Formatting: Don't run `wp_targeted_link_rel()` on entirely serialized content.

Props birgire, elliotcondon.
Fixes #46402.
Built from https://develop.svn.wordpress.org/trunk@45408


git-svn-id: http://core.svn.wordpress.org/trunk@45219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-05-25 12:05:52 +00:00
parent ca028cfc4c
commit a81dfbdf0e
2 changed files with 4 additions and 2 deletions

View File

@ -3040,7 +3040,9 @@ function wp_rel_nofollow_callback( $matches ) {
function wp_targeted_link_rel( $text ) {
// Don't run (more expensive) regex if no links with targets.
if ( stripos( $text, 'target' ) !== false && stripos( $text, '<a ' ) !== false ) {
$text = preg_replace_callback( '|<a\s([^>]*target\s*=[^>]*)>|i', 'wp_targeted_link_rel_callback', $text );
if ( ! is_serialized( $text ) ) {
$text = preg_replace_callback( '|<a\s([^>]*target\s*=[^>]*)>|i', 'wp_targeted_link_rel_callback', $text );
}
}
return $text;

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-45407';
$wp_version = '5.3-alpha-45408';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.