From 9cf9217686841bfceb7e2c03b10da88f006f4a5f Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 3 Oct 2017 15:27:26 -0700 Subject: don't use chanlink_url() for feed mentions --- include/items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index cc209aacf..dd8b394d3 100755 --- a/include/items.php +++ b/include/items.php @@ -4133,7 +4133,7 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C //$third = dba_timer(); - $items = fetch_post_tags($items,true); + $items = fetch_post_tags($items,false); //$fourth = dba_timer(); -- cgit v1.2.3 From 58155864cb7318321e70025ce67ca4453efee489 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 3 Oct 2017 15:36:56 -0700 Subject: urlencode hashes from mod_acl --- Zotlabs/Module/Acl.php | 4 ++-- include/text.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Zotlabs/Module/Acl.php b/Zotlabs/Module/Acl.php index 9c5f6653b..ce1064568 100644 --- a/Zotlabs/Module/Acl.php +++ b/Zotlabs/Module/Acl.php @@ -343,7 +343,7 @@ class Acl extends \Zotlabs\Web\Controller { "photo" => "images/twopeople.png", "name" => $g['name'] . (($type === 'f') ? '' : '+'), "id" => $g['id'] . (($type === 'f') ? '' : '+'), - "xid" => $g['hash'], + "xid" => urlencode($g['hash']), "link" => $g['nick'], "nick" => substr($g['nick'],0,strpos($g['nick'],'@')), "self" => (intval($g['abook_self']) ? 'abook-self' : ''), @@ -357,7 +357,7 @@ class Acl extends \Zotlabs\Web\Controller { "photo" => $g['micro'], "name" => $g['name'], "id" => $g['id'], - "xid" => $g['hash'], + "xid" => urlencode($g['hash']), "link" => $g['nick'], "nick" => (($g['nick']) ? substr($g['nick'],0,strpos($g['nick'],'@')) : $g['nick']), "self" => (intval($g['abook_self']) ? 'abook-self' : ''), diff --git a/include/text.php b/include/text.php index bd802b2c1..80914747b 100644 --- a/include/text.php +++ b/include/text.php @@ -2412,7 +2412,7 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag, $d } if(! $replaced) { - //base tag has the tags name only + // base tag has the tags name only if((substr($tag,0,7) === '#"') && (substr($tag,-6,6) === '"')) { $basetag = substr($tag,7); -- cgit v1.2.3 From d88d4b3c3ac1cd741f03b667b3d35696ba77d2dd Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 3 Oct 2017 15:43:51 -0700 Subject: wrong param --- Zotlabs/Module/Acl.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Zotlabs/Module/Acl.php b/Zotlabs/Module/Acl.php index ce1064568..e164875e8 100644 --- a/Zotlabs/Module/Acl.php +++ b/Zotlabs/Module/Acl.php @@ -342,8 +342,8 @@ class Acl extends \Zotlabs\Web\Controller { "type" => "c", "photo" => "images/twopeople.png", "name" => $g['name'] . (($type === 'f') ? '' : '+'), - "id" => $g['id'] . (($type === 'f') ? '' : '+'), - "xid" => urlencode($g['hash']), + "id" => urlencode($g['id']) . (($type === 'f') ? '' : '+'), + "xid" => $g['hash'], "link" => $g['nick'], "nick" => substr($g['nick'],0,strpos($g['nick'],'@')), "self" => (intval($g['abook_self']) ? 'abook-self' : ''), @@ -356,8 +356,8 @@ class Acl extends \Zotlabs\Web\Controller { "type" => "c", "photo" => $g['micro'], "name" => $g['name'], - "id" => $g['id'], - "xid" => urlencode($g['hash']), + "id" => urlencode($g['id']), + "xid" => $g['hash'], "link" => $g['nick'], "nick" => (($g['nick']) ? substr($g['nick'],0,strpos($g['nick'],'@')) : $g['nick']), "self" => (intval($g['abook_self']) ? 'abook-self' : ''), -- cgit v1.2.3 From 7fb02752de4e3ee62d84eaf30bcb4c155ebabf30 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 3 Oct 2017 17:03:24 -0700 Subject: hubzilla issue #868 --- Zotlabs/Module/Thing.php | 4 ++++ include/photo/photo_driver.php | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/Zotlabs/Module/Thing.php b/Zotlabs/Module/Thing.php index 95c6c5636..f816632ab 100644 --- a/Zotlabs/Module/Thing.php +++ b/Zotlabs/Module/Thing.php @@ -91,6 +91,7 @@ class Thing extends \Zotlabs\Web\Controller { } $orig_record = $t[0]; if($photo != $orig_record['obj_imgurl']) { + delete_thing_photo($orig_record['obj_imgurl'],get_observer_hash()); $arr = import_xchan_photo($photo,get_observer_hash(),true); $local_photo = $arr[0]; $local_photo_type = $arr[3]; @@ -336,6 +337,9 @@ class Thing extends \Zotlabs\Web\Controller { return ''; } + + delete_thing_photo($r[0]['obj_imgurl'],get_observer_hash()); + $x = q("delete from obj where obj_obj = '%s' and obj_type = %d and obj_channel = %d", dbesc($thing_hash), intval(TERM_OBJ_THING), diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 17ca81419..3b6beabf5 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -518,6 +518,27 @@ function guess_image_type($filename, $headers = '') { } + +function delete_thing_photo($url,$ob_hash) { + + $hash = basename($url); + $hash = substr($hash,0,strpos($hash,'-')); + + // hashes should be 32 bytes. + + if(strlen($hash) < 16) + return; + + $r = q("delete from photo where xchan = '%s' and photo_usage = %d and resource_id = '%s'", + dbesc($ob_hash), + intval(PHOTO_THING), + dbesc($hash) + ); + +} + + + function import_xchan_photo($photo,$xchan,$thing = false) { $flags = (($thing) ? PHOTO_THING : PHOTO_XCHAN); -- cgit v1.2.3 From d6b1eff70ef579036f706fde6c2ecfd8152317cb Mon Sep 17 00:00:00 2001 From: zotlabs Date: Tue, 3 Oct 2017 17:05:32 -0700 Subject: ensure we have an observer hash --- include/photo/photo_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 3b6beabf5..5eb1f9113 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -526,7 +526,7 @@ function delete_thing_photo($url,$ob_hash) { // hashes should be 32 bytes. - if(strlen($hash) < 16) + if((! $ob_hash) || (strlen($hash) < 16)) return; $r = q("delete from photo where xchan = '%s' and photo_usage = %d and resource_id = '%s'", -- cgit v1.2.3 From 80ca99fe5b9f7bb10ffae5789527b7a5d3c4f65e Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 4 Oct 2017 16:37:14 -0700 Subject: wiki double encoding html entities --- Zotlabs/Lib/MarkdownSoap.php | 2 +- Zotlabs/Render/Comanche.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Lib/MarkdownSoap.php b/Zotlabs/Lib/MarkdownSoap.php index 534ad819f..fa279b07c 100644 --- a/Zotlabs/Lib/MarkdownSoap.php +++ b/Zotlabs/Lib/MarkdownSoap.php @@ -94,7 +94,7 @@ class MarkdownSoap { } function escape($s) { - return htmlspecialchars($s,ENT_QUOTES); + return htmlspecialchars($s,ENT_QUOTES,'UTF-8',false); } static public function unescape($s) { diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php index beee9796e..d126cb3da 100644 --- a/Zotlabs/Render/Comanche.php +++ b/Zotlabs/Render/Comanche.php @@ -168,6 +168,8 @@ class Comanche { return $y['xchan_addr']; elseif($x[1] == 'name') return $y['xchan_name']; + elseif($x[1] == 'webname') + return substr($y['xchan_addr'],0,strpos($y['xchan_addr'],'@')); return false; } return get_observer_hash(); -- cgit v1.2.3 From 15b9a67c01964b83ac724945fe416dd35f66e914 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 4 Oct 2017 18:51:37 -0700 Subject: redirect loop with rmagic and owa --- Zotlabs/Module/Magic.php | 1 + Zotlabs/Module/Rmagic.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Magic.php b/Zotlabs/Module/Magic.php index d1550ec89..879085f96 100644 --- a/Zotlabs/Module/Magic.php +++ b/Zotlabs/Module/Magic.php @@ -149,6 +149,7 @@ class Magic extends \Zotlabs\Web\Controller { if($j['success'] && $j['token']) { $x = strpbrk($dest,'?&'); $args = (($x) ? '&owt=' . $j['token'] : '?f=&owt=' . $j['token']) . (($delegate) ? '&delegate=1' : ''); + goaway($dest . $args); } } diff --git a/Zotlabs/Module/Rmagic.php b/Zotlabs/Module/Rmagic.php index 0c4eb9ae4..bfc03f6ec 100644 --- a/Zotlabs/Module/Rmagic.php +++ b/Zotlabs/Module/Rmagic.php @@ -17,7 +17,7 @@ class Rmagic extends \Zotlabs\Web\Controller { if($r) { if($r[0]['hubloc_url'] === z_root()) goaway(z_root() . '/login'); - $dest = z_root() . '/' . str_replace('zid=','zid_=',\App::$query_string); + $dest = z_root() . '/' . str_replace(['rmagic','zid='],['','zid_='],\App::$query_string); goaway($r[0]['hubloc_url'] . '/magic' . '?f=&owa=1&dest=' . $dest); } } @@ -61,7 +61,7 @@ class Rmagic extends \Zotlabs\Web\Controller { if($_SESSION['return_url']) $dest = urlencode(z_root() . '/' . str_replace('zid=','zid_=',$_SESSION['return_url'])); else - $dest = urlencode(z_root() . '/' . str_replace('zid=','zid_=',\App::$query_string)); + $dest = urlencode(z_root() . '/' . str_replace([ 'rmagic', 'zid=' ] ,[ '', 'zid_='],\App::$query_string)); goaway($url . '/magic' . '?f=&owa=1&dest=' . $dest); } -- cgit v1.2.3 From 0ddc3e4af2fe70159b36f86cb367d1a24ec6ac71 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 5 Oct 2017 21:42:25 +0200 Subject: fix wrong logic for enable/disable pubstream notifications --- Zotlabs/Module/Settings/Channel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Settings/Channel.php b/Zotlabs/Module/Settings/Channel.php index e49c34666..41e23b717 100644 --- a/Zotlabs/Module/Settings/Channel.php +++ b/Zotlabs/Module/Settings/Channel.php @@ -201,7 +201,7 @@ class Channel { $vnotify += intval($_POST['vnotify11']); if(x($_POST,'vnotify12')) $vnotify += intval($_POST['vnotify12']); - if(x($_POST,'vnotify13') && ! get_config('system', 'disable_discover_tab')) + if(x($_POST,'vnotify13') && (get_config('system', 'disable_discover_tab') != 1)) $vnotify += intval($_POST['vnotify13']); $always_show_in_notices = x($_POST,'always_show_in_notices') ? 1 : 0; @@ -560,7 +560,7 @@ class Channel { '$vnotify10' => array('vnotify10', t('New connections'), ($vnotify & VNOTIFY_INTRO), VNOTIFY_INTRO, t('Recommended'), $yes_no), '$vnotify11' => array('vnotify11', t('System Registrations'), ($vnotify & VNOTIFY_REGISTER), VNOTIFY_REGISTER, '', $yes_no), '$vnotify12' => array('vnotify12', t('Unseen shared files'), ($vnotify & VNOTIFY_FILES), VNOTIFY_FILES, '', $yes_no), - '$vnotify13' => ((!get_config('system', 'disable_discover_tab')) ? array() : array('vnotify13', t('Unseen public activity'), ($vnotify & VNOTIFY_PUBS), VNOTIFY_PUBS, '', $yes_no)), + '$vnotify13' => ((get_config('system', 'disable_discover_tab') != 1) ? array('vnotify13', t('Unseen public activity'), ($vnotify & VNOTIFY_PUBS), VNOTIFY_PUBS, '', $yes_no) : array()), '$always_show_in_notices' => array('always_show_in_notices', t('Also show new wall posts, private messages and connections under Notices'), $always_show_in_notices, 1, '', $yes_no), '$evdays' => array('evdays', t('Notify me of events this many days in advance'), $evdays, t('Must be greater than 0')), -- cgit v1.2.3