aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2018-11-23 15:42:40 +0100
committerMario <mario@mariovavti.com>2018-11-23 15:42:40 +0100
commitf408ff982c5e8600a029ae75375660895ae87d8a (patch)
tree1698a0916141c85d24920fc44bd0a5fc236bd28d /include
parent85f52d2aeda44072013b9af5bfd470fbf47c2769 (diff)
parent9a8d1200ecc9f877b431a00a5219b41d2bd68de6 (diff)
downloadvolse-hubzilla-f408ff982c5e8600a029ae75375660895ae87d8a.tar.gz
volse-hubzilla-f408ff982c5e8600a029ae75375660895ae87d8a.tar.bz2
volse-hubzilla-f408ff982c5e8600a029ae75375660895ae87d8a.zip
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include')
-rw-r--r--include/attach.php4
-rwxr-xr-xinclude/items.php32
2 files changed, 19 insertions, 17 deletions
diff --git a/include/attach.php b/include/attach.php
index 6b0d3fb3b..dd718aa14 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -739,7 +739,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
}
if(! $hash)
- $hash = random_string();
+ $hash = new_uuid();
// Check storage limits
if($options !== 'update') {
@@ -1122,7 +1122,7 @@ function attach_mkdir($channel, $observer_hash, $arr = null) {
return $ret;
}
- $arr['hash'] = (($arr['hash']) ? $arr['hash'] : random_string());
+ $arr['hash'] = (($arr['hash']) ? $arr['hash'] : new_uuid());
// Check for duplicate name.
// Check both the filename and the hash as we will be making use of both.
diff --git a/include/items.php b/include/items.php
index 5346a141b..2cee376d0 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2644,28 +2644,30 @@ function tag_deliver($uid, $item_id) {
$plustagged = false;
$matches = array();
- $pattern = '/[\!@]\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($term['term'],'/') . '\[\/zrl\]/';
+ $pattern = '/[\!@]\!?\[[uz]rl\=' . preg_quote($term['url'],'/') . '\](.*?)\[\/[uz]rl\]/';
if(preg_match($pattern,$body,$matches))
$tagged = true;
- // original red forum tagging sequence @forumname+
+ $pattern = '/\[url\=' . preg_quote($term['url'],'/') . '\]\@(.*?)\[\/url\]/';
+ if(preg_match($pattern,$body,$matches))
+ $tagged = true;
+
+
// standard forum tagging sequence !forumname
- $pluspattern = '/@\!?\[zrl\=([^\]]*?)\]((?:.(?!\[zrl\=))*?)\+\[\/zrl\]/';
+ $forumpattern = '/\!\!?\[[uz]rl\=([^\]]*?)\]((?:.(?!\[[uz]rl\=))*?)\[\/[uz]rl\]/';
- $forumpattern = '/\!\!?\[zrl\=([^\]]*?)\]((?:.(?!\[zrl\=))*?)\[\/zrl\]/';
+ $forumpattern2 = '/\[[uz]rl\=([^\]]*?)\]\!((?:.(?!\[[uz]rl\=))*?)\[\/[uz]rl\]/';
- $found = false;
$matches = array();
- if(preg_match_all($pluspattern,$body,$matches,PREG_SET_ORDER)) {
+ if(preg_match_all($forumpattern,$body,$matches,PREG_SET_ORDER)) {
foreach($matches as $match) {
$matched_forums ++;
- if($term['url'] === $match[1] && intval($term['ttype']) === TERM_MENTION) {
+ if($term['url'] === $match[1] && intval($term['ttype']) === TERM_FORUM) {
if($matched_forums <= $max_forums) {
$plustagged = true;
- $found = true;
break;
}
logger('forum ' . $term['term'] . ' exceeded max_tagged_forums - ignoring');
@@ -2673,13 +2675,12 @@ function tag_deliver($uid, $item_id) {
}
}
- if(preg_match_all($forumpattern,$body,$matches,PREG_SET_ORDER)) {
+ if(preg_match_all($forumpattern2,$body,$matches,PREG_SET_ORDER)) {
foreach($matches as $match) {
$matched_forums ++;
if($term['url'] === $match[1] && intval($term['ttype']) === TERM_FORUM) {
if($matched_forums <= $max_forums) {
$plustagged = true;
- $found = true;
break;
}
logger('forum ' . $term['term'] . ' exceeded max_tagged_forums - ignoring');
@@ -2901,18 +2902,19 @@ function tgroup_check($uid, $item) {
$body = preg_replace('/\[share(.*?)\[\/share\]/','',$item['body']);
- $pluspattern = '/@\!?\[zrl\=([^\]]*?)\]((?:.(?!\[zrl\=))*?)\+\[\/zrl\]/';
-
$forumpattern = '/\!\!?\[zrl\=([^\]]*?)\]((?:.(?!\[zrl\=))*?)\[\/zrl\]/';
+ $forumpattern2 = '/\[zrl\=([^\]]*?)\]\!((?:.(?!\[zrl\=))*?)\[\/zrl\]/';
+
+
$found = false;
$matches = array();
- if(preg_match_all($pluspattern,$body,$matches,PREG_SET_ORDER)) {
+ if(preg_match_all($forumpattern,$body,$matches,PREG_SET_ORDER)) {
foreach($matches as $match) {
$matched_forums ++;
- if($term['url'] === $match[1] && intval($term['ttype']) === TERM_MENTION) {
+ if($term['url'] === $match[1] && intval($term['ttype']) === TERM_FORUM) {
if($matched_forums <= $max_forums) {
$found = true;
break;
@@ -2922,7 +2924,7 @@ function tgroup_check($uid, $item) {
}
}
- if(preg_match_all($forumpattern,$body,$matches,PREG_SET_ORDER)) {
+ if(preg_match_all($forumpattern2,$body,$matches,PREG_SET_ORDER)) {
foreach($matches as $match) {
$matched_forums ++;
if($term['url'] === $match[1] && intval($term['ttype']) === TERM_FORUM) {