aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/items.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php
index efc2322d5..c69ac2c84 100755
--- a/include/items.php
+++ b/include/items.php
@@ -167,6 +167,17 @@ function red_zrl_callback($matches) {
}
+// If we've got a url or zrl tag with a naked url somewhere in the link text,
+// escape it with quotes unless the naked url is a linked photo.
+
+function red_escape_zrl_callback($matches) {
+
+ // Uncertain why the url/zrl forms weren't picked up by the non-greedy regex.
+
+ if((strpos($matches[3],'zmg') !== false) || (strpos($matches[3],'img') !== false) || (strpos($matches[3],'zrl') !== false) || (strpos($matches[3],'url') !== false))
+ return $matches[0];
+ return '[' . $matches[1] . 'rl' . $matches[2] . ']' . $matches[3] . '"' . $matches[4] . '"' . $matches[5] . '[/' . $matches[6] . 'rl]';
+}
/**
* @function post_activity_item($arr)