wp_extract_urls() should not match dates.

Updates unit tests.

Props hinnerk, sergej.mueller.
Fixes #28222.


git-svn-id: https://develop.svn.wordpress.org/trunk@28882 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-06-28 04:15:30 +00:00
parent dca6040b0b
commit 56e66c79b4
2 changed files with 24 additions and 8 deletions

View File

@@ -441,7 +441,18 @@ function xmlrpc_removepostdata( $content ) {
*/
function wp_extract_urls( $content ) {
preg_match_all(
"#((?:[\w-]+://?|[\w\d]+[.])[^\s()<>]+[.](?:\([\w\d]+\)|(?:[^`!()\[\]{};:'\".,<>?«»“”‘’\s]|(?:[:]\d+)?/?)+))#",
"#("
. "(?: ([\w-]+:)?//? )"
. "[^\s()<>]+"
. "[.]"
. "(?:"
. "\([\w\d]+\) |"
. "(?:"
. "[^`!()\[\]{};:'\".,<>?«»“”‘’\s] |"
. "(?: [:]\d+ )?/?"
. ")+"
. ")"
. ")#x",
$content,
$post_links
);