mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 20:54:29 +00:00
wp_extract_urls() needs to also grab URLs with query strings and hashes.
Updates unit test. Props hauvong, dlh. Fixes #29314. git-svn-id: https://develop.svn.wordpress.org/trunk@29756 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -457,23 +457,23 @@ function xmlrpc_removepostdata( $content ) {
|
||||
*/
|
||||
function wp_extract_urls( $content ) {
|
||||
preg_match_all(
|
||||
"#("
|
||||
"#([\"']?)("
|
||||
. "(?:([\w-]+:)?//?)"
|
||||
. "[^\s()<>]+"
|
||||
. "[.]"
|
||||
. "(?:"
|
||||
. "\([\w\d]+\)|"
|
||||
. "(?:"
|
||||
. "[^`!()\[\]{};:'\".,<>?«»“”‘’\s]|"
|
||||
. "[^`!()\[\]{};:'\".,<>«»“”‘’\s]|"
|
||||
. "(?:[:]\d+)?/?"
|
||||
. ")+"
|
||||
. ")"
|
||||
. ")#",
|
||||
. ")\\1#",
|
||||
$content,
|
||||
$post_links
|
||||
);
|
||||
|
||||
$post_links = array_unique( array_map( 'html_entity_decode', $post_links[0] ) );
|
||||
$post_links = array_unique( array_map( 'html_entity_decode', $post_links[2] ) );
|
||||
|
||||
return array_values( $post_links );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user