From 26f593afaad84d264bcb02728edfc8cee63b3836 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 15 Nov 2018 13:52:25 -0800 Subject: [PATCH 01/10] delivery issue --- include/zot.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/zot.php b/include/zot.php index 49fc89e33..3ccf0a81f 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1187,13 +1187,13 @@ function zot_fetch($arr) { $zret = zot6_check_sig(); - if($zret['success'] && $zret['hubloc'] && $zret['hubloc']['hubloc_guid'] === $data['sender']['guid'] && $data['msg']) { + if($zret['success'] && $zret['hubloc'] && $zret['hubloc']['hubloc_guid'] === $arr['sender']['guid'] && $arr['msg']) { logger('zot6_delivery',LOGGER_DEBUG); - logger('zot6_data: ' . print_r($data,true),LOGGER_DATA); + logger('zot6_data: ' . print_r($arr,true),LOGGER_DATA); $ret['collected'] = true; - $import = [ 'success' => true, 'body' => json_encode( [ 'success' => true, 'pickup' => [ [ 'notify' => $data, 'message' => json_decode($data['msg'],true) ] ] ] ) ]; + $import = [ 'success' => true, 'body' => json_encode( [ 'success' => true, 'pickup' => [ [ 'notify' => $arr, 'message' => json_decode($arr['msg'],true) ] ] ] ) ]; $hubs = [ $zret['hubloc'] ] ; } From afc75af62f759181bbe6a806b523c6ca52126f5f Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 16 Nov 2018 22:14:11 +0100 Subject: [PATCH 02/10] strlen($this->imageString()) does not return the correct size when dealing with os_storage images. use filesize() instead. --- include/photo/photo_driver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 4173d727e..b70a13622 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -413,7 +413,7 @@ abstract class photo_driver { intval($p['width']), (intval($p['os_storage']) ? dbescbin($p['os_syspath']) : dbescbin($this->imageString())), intval($p['os_storage']), - intval(strlen($this->imageString())), + (intval($p['os_storage']) ? @filesize($p['os_syspath']) : strlen($this->imageString())), intval($p['imgscale']), intval($p['photo_usage']), dbesc($p['title']), @@ -445,7 +445,7 @@ abstract class photo_driver { intval($p['width']), (intval($p['os_storage']) ? dbescbin($p['os_syspath']) : dbescbin($this->imageString())), intval($p['os_storage']), - intval(strlen($this->imageString())), + (intval($p['os_storage']) ? @filesize($p['os_syspath']) : strlen($this->imageString())), intval($p['imgscale']), intval($p['photo_usage']), dbesc($p['title']), From f15e32d0637fdf84de7cab43b558ec8a383d3cf5 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 17 Nov 2018 09:41:26 +0100 Subject: [PATCH 03/10] recalculate photo filesize when rotating an image --- Zotlabs/Module/Photos.php | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index 03fd8a53d..21f6293ef 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -264,7 +264,7 @@ class Photos extends \Zotlabs\Web\Controller { } $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 0", - dbesc(datetime_convert()), + dbesc(datetime_convert()), dbescbin($data), intval($fsize), intval($height), @@ -278,10 +278,13 @@ class Photos extends \Zotlabs\Web\Controller { $width = $ph->getWidth(); $height = $ph->getHeight(); + $data = $ph->imageString(); + $fsize = strlen($data); - $x = q("update photo set edited = '%s', content = '%s', height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 1", - dbesc(datetime_convert()), - dbescbin($ph->imageString()), + $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 1", + dbesc(datetime_convert()), + dbescbin($data), + intval($fsize), intval($height), intval($width), dbesc($resource_id), @@ -294,10 +297,13 @@ class Photos extends \Zotlabs\Web\Controller { $width = $ph->getWidth(); $height = $ph->getHeight(); + $data = $ph->imageString(); + $fsize = strlen($data); - $x = q("update photo set edited = '%s', content = '%s', height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 2", - dbesc(datetime_convert()), - dbescbin($ph->imageString()), + $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 2", + dbesc(datetime_convert()), + dbescbin($data), + intval($fsize), intval($height), intval($width), dbesc($resource_id), @@ -310,10 +316,13 @@ class Photos extends \Zotlabs\Web\Controller { $width = $ph->getWidth(); $height = $ph->getHeight(); + $data = $ph->imageString(); + $fsize = strlen($data); - $x = q("update photo set edited = '%s', content = '%s', height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 3", - dbesc(datetime_convert()), - dbescbin($ph->imageString()), + $x = q("update photo set edited = '%s', content = '%s', filesize = %d, height = %d, width = %d where resource_id = '%s' and uid = %d and imgscale = 3", + dbesc(datetime_convert()), + dbescbin($data), + intval($fsize), intval($height), intval($width), dbesc($resource_id), From ae97649948b8af575441e5a1f5b69db9f627a0e2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 19 Nov 2018 10:42:18 +0100 Subject: [PATCH 04/10] update sql schemas to include update column in pconfig table --- install/schema_mysql.sql | 6 +++--- install/schema_postgres.sql | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index ef7e2a516..7b7d9cc3a 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -910,7 +910,6 @@ CREATE TABLE IF NOT EXISTS `outq` ( KEY `outq_priority` (`outq_priority`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - CREATE TABLE IF NOT EXISTS pchan ( `pchan_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `pchan_guid` char(191) NOT NULL DEFAULT '', @@ -922,15 +921,16 @@ CREATE TABLE IF NOT EXISTS pchan ( KEY `pchan_hash` (`pchan_hash`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - CREATE TABLE IF NOT EXISTS `pconfig` ( `id` int(11) NOT NULL AUTO_INCREMENT, `uid` int(11) NOT NULL DEFAULT 0 , `cat` char(191) NOT NULL DEFAULT '', `k` char(191) NOT NULL DEFAULT '', `v` mediumtext NOT NULL, + `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00', PRIMARY KEY (`id`), - UNIQUE KEY `access` (`uid`,`cat`,`k`) + UNIQUE KEY `access` (`uid`,`cat`,`k`), + KEY `pconfig_updated` (`updated`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `photo` ( diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index cb4476628..fd827978c 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -891,7 +891,6 @@ create index "outq_async" on outq ("outq_async"); create index "outq_delivered" on outq ("outq_delivered"); create index "outq_priority" on outq ("outq_priority"); - CREATE TABLE "pchan" ( "pchan_id" serial NOT NULL, "pchan_guid" text NOT NULL, @@ -900,7 +899,6 @@ CREATE TABLE "pchan" ( "pchan_prvkey" text NOT NULL, PRIMARY KEY ("pchan_id") ); - create index "pchan_guid" on pchan ("pchan_guid"); create index "pchan_hash" on pchan ("pchan_hash"); @@ -910,9 +908,11 @@ CREATE TABLE "pconfig" ( "cat" text NOT NULL, "k" text NOT NULL, "v" text NOT NULL, + "updated" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', PRIMARY KEY ("id"), UNIQUE ("uid","cat","k") ); +create index "pconfig_updated_idx" on pconfig ("updated"); CREATE TABLE "photo" ( "id" serial NOT NULL, From 7be1d9e45aa054a7ffa79220f24db95c006e44e8 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 19 Nov 2018 09:44:41 +0000 Subject: [PATCH 05/10] Merge branch 'patch-20181118a' into 'dev' Patch 20181118a - fix delayed publication of posts See merge request hubzilla/core!1398 (cherry picked from commit f34af496ec82555a0e070e91260dc6edb17f2d5a) 3787c490 Fix: delayed items propagate before publication on cloned channels --- include/items.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/items.php b/include/items.php index cae380b01..d8a9e8e56 100755 --- a/include/items.php +++ b/include/items.php @@ -608,8 +608,6 @@ function get_item_elements($x,$allow_code = false) { $arr['created'] = datetime_convert('UTC','UTC',$x['created']); $arr['edited'] = datetime_convert('UTC','UTC',$x['edited']); - if($arr['created'] > datetime_convert()) - $arr['created'] = datetime_convert(); if($arr['edited'] > datetime_convert()) $arr['edited'] = datetime_convert(); From 5cb4cdaa5e42f87e9d26501150d6d689b56a1cd2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 19 Nov 2018 11:10:22 +0100 Subject: [PATCH 06/10] changelog --- CHANGELOG | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 59e8bdfc9..b11016eba 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,12 @@ +Hubzilla 3.8.5 (2018-11-19) + - Fix pconfig for new installs + - Fix delayed publication of posts in combination with channel clones + - Fix issue where photo filesize was not updated in the DB when a photo was edited + - Fix issue where the original photo size was not set correct in the DB + - Fix delivery issue in zot_fetch() + - Fix typo in channel reputation addon + + Hubzilla 3.8.4 (2018-11-14) - Fix xss issue (thanks to Eduardo) - Implement hook in enotify to be used by superblock From 1044e8e91aff34df850c8408731f8c21280b8fda Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 19 Nov 2018 11:12:32 +0100 Subject: [PATCH 07/10] version 3.8.5 --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot.php b/boot.php index f4ef1a036..cbaec7000 100755 --- a/boot.php +++ b/boot.php @@ -50,7 +50,7 @@ require_once('include/attach.php'); require_once('include/bbcode.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '3.8.4' ); +define ( 'STD_VERSION', '3.8.5' ); define ( 'ZOT_REVISION', '6.0a' ); define ( 'DB_UPDATE_VERSION', 1225 ); From a12abaac9da8e0563d0a184bf0803c8283a2c3f2 Mon Sep 17 00:00:00 2001 From: harukin Date: Mon, 19 Nov 2018 22:30:10 +0900 Subject: [PATCH 08/10] =?UTF-8?q?=E8=A6=8F=E7=B4=84=E8=AA=A4=E6=A4=8D?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/SiteTOS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/SiteTOS.md b/doc/SiteTOS.md index 70df8a113..705c704c6 100644 --- a/doc/SiteTOS.md +++ b/doc/SiteTOS.md @@ -37,7 +37,7 @@ 本規約と追加規定との間に矛盾が存在する場合には、追加規定が本規約に優先します。 -ユーザーが本規約を遵守しない場合に、Google が直ちに法的措置を講じないことがあったとしても、そのことによって、鯖主が有している権利(たとえば、将来において、法的措置を講じる権利)を放棄しようとしていることを意味するものではありません。 +ユーザーが本規約を遵守しない場合に、鯖主が直ちに法的措置を講じないことがあったとしても、そのことによって、鯖主が有している権利(たとえば、将来において、法的措置を講じる権利)を放棄しようとしていることを意味するものではありません。 ある特定の規定が強制執行不可能であることが判明した場合であっても、そのことは他のいずれの規定にも影響を及ぼすものではありません。 From f8a8559523c9c943488f690c1d3f832445a95f67 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 18 Nov 2018 10:02:01 +0000 Subject: [PATCH 09/10] fix typo which prevented propagation of comments (cherry picked from commit 0c94747ab1c740f47e5a796f5c60efcdfcd29ba1) --- Zotlabs/Module/Zot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/Zot.php b/Zotlabs/Module/Zot.php index 8c34dced1..1cc0e54c9 100644 --- a/Zotlabs/Module/Zot.php +++ b/Zotlabs/Module/Zot.php @@ -19,7 +19,7 @@ class Zot extends \Zotlabs\Web\Controller { function init() { $zot = new ZotProtocol\Receiver(new ZotProtocol\Zot6Handler()); - json_return_and_die($zot->run(),'application/x-zot+jzon'); + json_return_and_die($zot->run(),'application/x-zot+json'); } } From 0bba9482dfbcc0fd8bea880ac3820548281ecfc2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 21 Nov 2018 13:21:29 +0100 Subject: [PATCH 10/10] fix call to undefined function --- Zotlabs/Lib/PConfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Lib/PConfig.php b/Zotlabs/Lib/PConfig.php index b9384cf6b..5e5954c95 100644 --- a/Zotlabs/Lib/PConfig.php +++ b/Zotlabs/Lib/PConfig.php @@ -138,7 +138,7 @@ class PConfig { $hash = hash('sha256',$family.':'.$key); if (self::Get($uid, 'hz_delpconfig', $hash) !== false) { - if (Get($uid, 'hz_delpconfig', $hash) > $updated) { + if (self::Get($uid, 'hz_delpconfig', $hash) > $updated) { logger('Refusing to update pconfig with outdated info (Item deleted more recently).', LOGGER_NORMAL, LOG_ERR); return self::Get($uid,$family,$key); } else {