aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-05-29 16:14:10 -0700
committerfriendica <info@friendica.com>2014-05-29 16:14:10 -0700
commit9b5eabf1083602382385c62c6ad7d8ae8e167f9e (patch)
treea73ed07970a517dbad90f14954fea790193813c3 /include/items.php
parenta00103b7dfa0b128cbe6ab03e6a43ccedb24f8c2 (diff)
parent1a58777daa0ab9394f38737a806a7a185ebceeb0 (diff)
downloadvolse-hubzilla-9b5eabf1083602382385c62c6ad7d8ae8e167f9e.tar.gz
volse-hubzilla-9b5eabf1083602382385c62c6ad7d8ae8e167f9e.tar.bz2
volse-hubzilla-9b5eabf1083602382385c62c6ad7d8ae8e167f9e.zip
Merge branch 'master' into newevent
Conflicts: include/zot.php
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php35
1 files changed, 30 insertions, 5 deletions
diff --git a/include/items.php b/include/items.php
index 7a94336be..1c44b7df5 100755
--- a/include/items.php
+++ b/include/items.php
@@ -239,6 +239,31 @@ function red_unescape_codeblock($m) {
}
+function red_zrlify_img_callback($matches) {
+ $m = @parse_url($matches[2]);
+ $zrl = false;
+ if($m['host']) {
+ $r = q("select hubloc_url from hubloc where hubloc_host = '%s' limit 1",
+ dbesc($m['host'])
+ );
+ if($r)
+ $zrl = true;
+ }
+
+ $t = strip_zids($matches[2]);
+ if($t !== $matches[2]) {
+ $zrl = true;
+ $matches[2] = $t;
+ }
+
+ if($zrl)
+ return '[zmg' . $matches[1] . ']' . $matches[2] . '[/zmg]';
+ return $matches[0];
+}
+
+
+
+
/**
* @function post_activity_item($arr)
*
@@ -2413,7 +2438,7 @@ function tag_deliver($uid,$item_id) {
if($terms) {
foreach($terms as $term) {
- if((strcasecmp($term['term'],$u[0]['channel_name']) == 0) && link_compare($term['url'],$link)) {
+ if(link_compare($term['url'],$link)) {
$mention = true;
break;
}
@@ -2449,11 +2474,11 @@ function tag_deliver($uid,$item_id) {
$tagged = false;
$plustagged = false;
- $pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($u[0]['channel_name'],'/') . '\[\/zrl\]/';
+ $pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($term['term'],'/') . '\[\/zrl\]/';
if(preg_match($pattern,$body,$matches))
$tagged = true;
- $pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($u[0]['channel_name'] . '+','/') . '\[\/zrl\]/';
+ $pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($term['term'] . '+','/') . '\[\/zrl\]/';
if(preg_match($pattern,$body,$matches))
$plustagged = true;
@@ -2582,7 +2607,7 @@ function tgroup_check($uid,$item) {
if($terms) {
foreach($terms as $term) {
- if(($term['term'] == $u[0]['channel_name']) && link_compare($term['url'],$link)) {
+ if(link_compare($term['url'],$link)) {
$mention = true;
break;
}
@@ -2600,7 +2625,7 @@ function tgroup_check($uid,$item) {
$body = preg_replace('/\[share(.*?)\[\/share\]/','',$item['body']);
- $pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($u[0]['channel_name'] . '+','/') . '\[\/zrl\]/';
+ $pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($term['term'] . '+','/') . '\[\/zrl\]/';
if(! preg_match($pattern,$body,$matches)) {
logger('tgroup_check: mention was in a reshare - ignoring');