diff options
author | zotlabs <mike@macgirvin.com> | 2019-07-28 20:00:14 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2019-07-28 20:00:14 -0700 |
commit | 70e4a2c4fa69135dea97d1b6323fe6f8e17961c7 (patch) | |
tree | 38e8f097ec0d9aecb12dcce0bfcf239af37cebbf /include | |
parent | 696359daba11c51d8f733dfa173e48b5e1de69ef (diff) | |
parent | 5695350e98a8a2c802ff419c5b29b0f01f0180df (diff) | |
download | volse-hubzilla-70e4a2c4fa69135dea97d1b6323fe6f8e17961c7.tar.gz volse-hubzilla-70e4a2c4fa69135dea97d1b6323fe6f8e17961c7.tar.bz2 volse-hubzilla-70e4a2c4fa69135dea97d1b6323fe6f8e17961c7.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'include')
-rwxr-xr-x | include/items.php | 9 | ||||
-rw-r--r-- | include/network.php | 11 | ||||
-rw-r--r-- | include/text.php | 8 |
3 files changed, 15 insertions, 13 deletions
diff --git a/include/items.php b/include/items.php index 4fc659926..84bfc263b 100755 --- a/include/items.php +++ b/include/items.php @@ -3722,13 +3722,12 @@ function drop_item($id,$interactive = true,$stage = DROPITEM_NORMAL) { if(! $interactive) $ok_to_delete = true; - // owner deletion - if(local_channel() && local_channel() == $item['uid']) + // admin deletion + if(is_site_admin()) $ok_to_delete = true; - // sys owned item, requires site admin to delete - $sys = get_sys_channel(); - if(is_site_admin() && $sys['channel_id'] == $item['uid']) + // owner deletion + if(local_channel() && local_channel() == $item['uid']) $ok_to_delete = true; // author deletion diff --git a/include/network.php b/include/network.php index c754625cd..f6992291d 100644 --- a/include/network.php +++ b/include/network.php @@ -1183,12 +1183,12 @@ function discover_by_webbie($webbie, $protocol = '') { */ function webfinger_rfc7033($webbie, $zot = false) { - if(strpos($webbie,'@')) { + if(filter_var($webbie, FILTER_VALIDATE_EMAIL)) { $lhs = substr($webbie,0,strpos($webbie,'@')); $rhs = substr($webbie,strpos($webbie,'@')+1); $resource = urlencode('acct:' . $webbie); } - else { + elseif(filter_var($webbie, FILTER_VALIDATE_URL)) { $m = parse_url($webbie); if($m) { if($m['scheme'] !== 'https') @@ -1197,9 +1197,10 @@ function webfinger_rfc7033($webbie, $zot = false) { $rhs = $m['host'] . (($m['port']) ? ':' . $m['port'] : ''); $resource = urlencode($webbie); } - else - return false; } + else + return false; + logger('fetching url from resource: ' . $rhs . ':' . $webbie); $counter = 0; @@ -1217,7 +1218,7 @@ function webfinger_rfc7033($webbie, $zot = false) { function old_webfinger($webbie) { $host = ''; - if(strstr($webbie,'@')) + if(filter_var($webbie, FILTER_VALIDATE_EMAIL)) $host = substr($webbie,strpos($webbie,'@') + 1); if(strlen($host)) { diff --git a/include/text.php b/include/text.php index a49ff5a29..572b43916 100644 --- a/include/text.php +++ b/include/text.php @@ -1572,7 +1572,9 @@ function format_hashtags(&$item) { $term = htmlspecialchars($t['term'], ENT_COMPAT, 'UTF-8', false) ; if(! trim($term)) continue; - if($t['url'] && strpos($item['body'], $t['url'])) + if(empty($t['url'])) + continue; + if(strpos($item['body'], $t['url']) || strpos($item['body'], '#' . $t['term'])) continue; if($s) $s .= ' '; @@ -2456,8 +2458,8 @@ function magic_link($s) { * @param boolean $escape (optional) default false */ function stringify_array_elms(&$arr, $escape = false) { - for($x = 0; $x < count($arr); $x ++) - $arr[$x] = "'" . (($escape) ? dbesc($arr[$x]) : $arr[$x]) . "'"; + foreach($arr as $k => $v) + $arr[$k] = "'" . (($escape) ? dbesc($v) : $v) . "'"; } |