Formatting: Make sure `links_add_target()` adds the `target` attribute to the correct tag.
Previously, the attribute could unintentionally be added to a tag that starts with the same characters, e.g. `<aside>` instead of `<a>`. Props antonlukin. Fixes #51313. Built from https://develop.svn.wordpress.org/trunk@48983 git-svn-id: http://core.svn.wordpress.org/trunk@48745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
75262781d9
commit
ac00862f44
|
@ -5243,7 +5243,7 @@ function links_add_target( $content, $target = '_blank', $tags = array( 'a' ) )
|
|||
global $_links_add_target;
|
||||
$_links_add_target = $target;
|
||||
$tags = implode( '|', (array) $tags );
|
||||
return preg_replace_callback( "!<($tags)([^>]*)>!i", '_links_add_target', $content );
|
||||
return preg_replace_callback( "!<($tags)((\s[^>]*)?)>!i", '_links_add_target', $content );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.6-alpha-48982';
|
||||
$wp_version = '5.6-alpha-48983';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue