]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
wrap multiline regexp in quotes so it doesn't mess up my editor's indenting
authorEvan Prodromou <evan@controlyourself.ca>
Thu, 12 Feb 2009 12:58:36 +0000 (07:58 -0500)
committerEvan Prodromou <evan@controlyourself.ca>
Thu, 12 Feb 2009 12:58:36 +0000 (07:58 -0500)
lib/util.php

index c0c98011166c26b99a8b3d0aea6867cad9a2180d..03e3618db8e1b751a1773231c1adc8b6ef4d6d5e 100644 (file)
@@ -394,20 +394,20 @@ function common_render_text($text)
 
 function common_replace_urls_callback($text, $callback) {
     // Start off with a regex
-    $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';
+    $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