summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-02-06 14:28:17 -0500
committerEvan Prodromou <evan@controlyourself.ca>2009-02-06 14:28:17 -0500
commitbe6ce275387971692944c3677ea5e03f6fd038f8 (patch)
tree8f35f787e90a522a354b8702f5e712eae8b1d6c7 /lib
parent5cdead72cdee1261e506cdc89dd81242bfb9ba84 (diff)
parentadcbb483623f10fa7ed76cc85c6c20e3647fa9f3 (diff)
Merge branch 'sgmurphy-clone/0.7.x' into 0.7.x
Conflicts: lib/util.php
Diffstat (limited to 'lib')
-rw-r--r--lib/util.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/util.php b/lib/util.php
index 0655ebf27..7ce4e229e 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -394,7 +394,21 @@ 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;