aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/text.php')
-rwxr-xr-xinclude/text.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/text.php b/include/text.php
index 00e95a2bb..086104466 100755
--- a/include/text.php
+++ b/include/text.php
@@ -1144,12 +1144,13 @@ function prepare_text($text,$content_type = 'text/bbcode') {
function zidify_callback($match) {
- if (feature_enabled(local_user(),'sendzid')) {
- $replace = '<a' . $match[1] . ' href="' . zid($match[2]) . '"';}
+ if (feature_enabled(local_user(),'sendzid')) {
+ $replace = '<a' . $match[1] . ' href="' . zid($match[2]) . '"';
+ }
+ else {
+ $replace = '<a' . $match[1] . 'class="zrl"' . $match[2] . ' href="' . zid($match[3]) . '"';
+ }
- else {
- $replace = '<a' . $match[1] . 'class="zrl"' . $match[2] . ' href="' . zid($match[3]) . '"';}
-
$x = str_replace($match[0],$replace,$match[0]);
return $x;
}
@@ -1174,7 +1175,8 @@ function zidify_links($s) {
}
else {
$s = preg_replace_callback('/\<a(.*?)class\=\"zrl\"(.*?)href\=\"(.*?)\"/ism','zidify_callback',$s);
- // FIXME zidify only img links from known Red servers.
+ $s = preg_replace_callback('/\<img class\=\"zrl\"(.*?)src\=\"(.*?)\"/ism','zidify_img_callback',$s);
+// FIXME - remove the following line and redo the regex for the prev line once all Red images are converted to zmg
$s = preg_replace_callback('/\<img(.*?)src\=\"(.*?)\"/ism','zidify_img_callback',$s);
}