From: Evan Prodromou Date: Fri, 6 Feb 2009 19:28:17 +0000 (-0500) Subject: Merge branch 'sgmurphy-clone/0.7.x' into 0.7.x X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=be6ce275387971692944c3677ea5e03f6fd038f8;p=quix0rs-gnu-social.git Merge branch 'sgmurphy-clone/0.7.x' into 0.7.x Conflicts: lib/util.php --- be6ce275387971692944c3677ea5e03f6fd038f8 diff --cc lib/util.php index 0655ebf276,35a9d0bd4f..7ce4e229eb --- a/lib/util.php +++ b/lib/util.php @@@ -394,8 -394,22 +394,22 @@@ function common_render_text($text function common_replace_urls_callback($text, $callback) { // Start off with a regex - preg_match_all('#(?:(?:(?:https?|ftps?|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|xmpp|irc)://|(?:mailto|aim|tel):)[^.\s]+\.[^\s]+|(?:[^.\s/]+\.)+(?:museum|travel|[a-z]{2,4})(?:[:/][^\s]*)?)#i', $text, $matches); + $regex = '# + (?: + (?: + (?:https?|ftps?|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|xmpp|irc):// + | + (?:mailto|aim|tel): + ) + [^.\s]+\.[^\s]+ + | + (?:[^.\s/:]+\.)+ + (?:museum|travel|[a-z]{2,4}) + (?:[:/][^\s]*)? + ) + #ix'; + preg_match_all($regex, $text, $matches); - + // Then clean up what the regex left behind $offset = 0; foreach($matches[0] as $url) {