diff options
author | friendica <info@friendica.com> | 2013-05-28 04:50:16 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-05-28 04:50:16 -0700 |
commit | 08a4ffd6633896a75f1aa66c7c310fc6fd991912 (patch) | |
tree | dd6bcff6137bceef34283ecfc684b2435b5bd406 /include/text.php | |
parent | e81e11382f9c746c59fa11b3baef401f8c328cd4 (diff) | |
download | volse-hubzilla-08a4ffd6633896a75f1aa66c7c310fc6fd991912.tar.gz volse-hubzilla-08a4ffd6633896a75f1aa66c7c310fc6fd991912.tar.bz2 volse-hubzilla-08a4ffd6633896a75f1aa66c7c310fc6fd991912.zip |
convert most red photos to zmg
Diffstat (limited to 'include/text.php')
-rwxr-xr-x | include/text.php | 14 |
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); } |