mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-12 13:44:21 +01:00
Add unit tests for links_add_target()
. Alter the patterns in links_add_target()
and _links_add_target()
slightly based on learnings after running tests.
Props mdbitz. Fixes #26164. Built from https://develop.svn.wordpress.org/trunk@26328 git-svn-id: http://core.svn.wordpress.org/trunk@26230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
28c19ec965
commit
dc01b08a5e
@ -3243,7 +3243,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)([^>]*)>!i", '_links_add_target', $content );
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user