aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-02-18 19:47:13 -0800
committerfriendica <info@friendica.com>2014-02-18 19:47:13 -0800
commit6ac81c936077caa7167ddc3a2eb3c1022826d5d9 (patch)
treef2bfa45e5e34f5b5d0ce4ad78ba184a3dabf03b2
parenta258c8b98b019924e0b6ff28941599b80490e4d6 (diff)
downloadvolse-hubzilla-6ac81c936077caa7167ddc3a2eb3c1022826d5d9.tar.gz
volse-hubzilla-6ac81c936077caa7167ddc3a2eb3c1022826d5d9.tar.bz2
volse-hubzilla-6ac81c936077caa7167ddc3a2eb3c1022826d5d9.zip
fix zrl bookmarks which broke with this checkin: c9192991c95a5145
It was documented that: Issues: Currently the order of HTML parameters in the text is somewhat rigid and inflexible. but as that was in a different function it was easy to overlook.
-rwxr-xr-xinclude/text.php33
1 files changed, 6 insertions, 27 deletions
diff --git a/include/text.php b/include/text.php
index 2bf760035..dfd35c769 100755
--- a/include/text.php
+++ b/include/text.php
@@ -1324,24 +1324,15 @@ 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]) . '"';
- }
- else {
- $replace = '<a' . $match[1] . 'class="zrl"' . $match[2] . ' href="' . zid($match[3]) . '"';
- }
-
+ $is_zid = ((feature_enabled(local_user(),'sendzid')) || (strpos($match[1],'zrl')) ? true : false);
+ $replace = '<a' . $match[1] . ' href="' . (($is_zid) ? zid($match[2]) : $match[2]) . '"';
$x = str_replace($match[0],$replace,$match[0]);
return $x;
}
function zidify_img_callback($match) {
- if (feature_enabled(local_user(),'sendzid')) {
- $replace = '<img' . $match[1] . ' src="' . zid($match[2]) . '"';
- }
- else {
- $replace = '<img' . $match[1] . ' src="' . zid($match[2]) . '"';
- }
+ $is_zid = ((feature_enabled(local_user(),'sendzid')) || (strpos($match[1],'zrl')) ? true : false);
+ $replace = '<img' . $match[1] . ' src="' . (($is_zid) ? zid($match[2]) : $match[2]) . '"';
$x = str_replace($match[0],$replace,$match[0]);
return $x;
@@ -1349,25 +1340,13 @@ function zidify_img_callback($match) {
function zidify_links($s) {
- if(feature_enabled(local_user(),'sendzid')) {
- $s = preg_replace_callback('/\<a(.*?)href\=\"(.*?)\"/ism','zidify_callback',$s);
- $s = preg_replace_callback('/\<img(.*?)src\=\"(.*?)\"/ism','zidify_img_callback',$s);
- }
- else {
- $s = preg_replace_callback('/\<a(.*?)class\=\"zrl\"(.*?)href\=\"(.*?)\"/ism','zidify_callback',$s);
- $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);
- }
-
+ $s = preg_replace_callback('/\<a(.*?)href\=\"(.*?)\"/ism','zidify_callback',$s);
+ $s = preg_replace_callback('/\<img(.*?)src\=\"(.*?)\"/ism','zidify_img_callback',$s);
return $s;
}
-
-
-
/**
* return atom link elements for all of our hubs
*/