From ca4e7f9b4fab7035e511582a0755d58e9e4fa2f0 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 15 Nov 2018 10:11:04 +0100 Subject: fix update 1228 --- Zotlabs/Update/_1228.php | 1 - 1 file changed, 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Update/_1228.php b/Zotlabs/Update/_1228.php index b9ba1d86f..f8a506bb4 100644 --- a/Zotlabs/Update/_1228.php +++ b/Zotlabs/Update/_1228.php @@ -25,7 +25,6 @@ class _1228 { if($r) { q("COMMIT"); - self::upgrade(); return UPDATE_SUCCESS; } -- cgit v1.2.3 From 6010b5c6198bf49c39029a657443b5bf1be8b408 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 16 Nov 2018 23:14:10 +0100 Subject: Fix return on wrong sotred in Content-Length size for full size photos --- Zotlabs/Module/Photo.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 30e8340e2..91175c7df 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -163,11 +163,13 @@ class Photo extends \Zotlabs\Web\Controller { if($exists && $allowed) { $data = dbunescbin($e[0]['content']); - $filesize = $e[0]['filesize']; $mimetype = $e[0]['mimetype']; $modified = strtotime($e[0]['edited'] . 'Z'); - if(intval($e[0]['os_storage'])) + if(intval($e[0]['os_storage'])) { $streaming = $data; + } + else + $filesize = $e[0]['filesize']; if($e[0]['allow_cid'] != '' || $e[0]['allow_gid'] != '' || $e[0]['deny_gid'] != '' || $e[0]['deny_gid'] != '') $prvcachecontrol = true; } -- cgit v1.2.3 From 238a616292ad5c6e7be97a4dd763a302729abf80 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 16 Nov 2018 23:33:45 +0100 Subject: Add filesize for streaming content --- Zotlabs/Module/Photo.php | 1 + 1 file changed, 1 insertion(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 91175c7df..be9d55eb2 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -167,6 +167,7 @@ class Photo extends \Zotlabs\Web\Controller { $modified = strtotime($e[0]['edited'] . 'Z'); if(intval($e[0]['os_storage'])) { $streaming = $data; + $filesize = filesize($data); } else $filesize = $e[0]['filesize']; -- cgit v1.2.3 From 783cca1e13ae480b31ddcffce6f014fbd1cdc34a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 17 Nov 2018 08:41:26 +0000 Subject: recalculate photo filesize when rotating an image (cherry picked from commit f15e32d0637fdf84de7cab43b558ec8a383d3cf5) --- Zotlabs/Module/Photos.php | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'Zotlabs') 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), -- cgit v1.2.3 From 0c94747ab1c740f47e5a796f5c60efcdfcd29ba1 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 18 Nov 2018 11:02:01 +0100 Subject: fix typo which prevented propagation of comments --- Zotlabs/Module/Zot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') 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'); } } -- cgit v1.2.3 From af0c2f59cc1a51d2e1847682f6d66ab4dc600004 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 19 Nov 2018 13:11:04 +0100 Subject: Revert "Add filesize for streaming content" This reverts commit 238a616292ad5c6e7be97a4dd763a302729abf80 --- Zotlabs/Module/Photo.php | 1 - 1 file changed, 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index be9d55eb2..91175c7df 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -167,7 +167,6 @@ class Photo extends \Zotlabs\Web\Controller { $modified = strtotime($e[0]['edited'] . 'Z'); if(intval($e[0]['os_storage'])) { $streaming = $data; - $filesize = filesize($data); } else $filesize = $e[0]['filesize']; -- cgit v1.2.3 From 73b836c73d6804bc29d7de89cd6397bfe857f9d7 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 19 Nov 2018 13:11:18 +0100 Subject: Revert "Fix return on wrong sotred in Content-Length size for full size photos" This reverts commit 6010b5c6198bf49c39029a657443b5bf1be8b408 --- Zotlabs/Module/Photo.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 91175c7df..30e8340e2 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -163,13 +163,11 @@ class Photo extends \Zotlabs\Web\Controller { if($exists && $allowed) { $data = dbunescbin($e[0]['content']); + $filesize = $e[0]['filesize']; $mimetype = $e[0]['mimetype']; $modified = strtotime($e[0]['edited'] . 'Z'); - if(intval($e[0]['os_storage'])) { + if(intval($e[0]['os_storage'])) $streaming = $data; - } - else - $filesize = $e[0]['filesize']; if($e[0]['allow_cid'] != '' || $e[0]['allow_gid'] != '' || $e[0]['deny_gid'] != '' || $e[0]['deny_gid'] != '') $prvcachecontrol = true; } -- cgit v1.2.3 From e30be643c9f217dc379aac0feb085a1b1ffa44e1 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 21 Nov 2018 12:21:29 +0000 Subject: fix call to undefined function (cherry picked from commit 0bba9482dfbcc0fd8bea880ac3820548281ecfc2) --- Zotlabs/Lib/PConfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') 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 { -- cgit v1.2.3 From 16c7aa2813b8a7fca52ac3f214c214cc01834308 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 22 Nov 2018 12:52:08 +0100 Subject: fix db upgrade 1228 for postgres --- Zotlabs/Update/_1228.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Update/_1228.php b/Zotlabs/Update/_1228.php index f8a506bb4..9e6bf8047 100644 --- a/Zotlabs/Update/_1228.php +++ b/Zotlabs/Update/_1228.php @@ -11,8 +11,8 @@ class _1228 { if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { $r1 = q("ALTER TABLE item ADD uuid text NOT NULL DEFAULT '' "); - $r2 = q("create index \"uuid_idx\" on channel (\"uuid\")"); - $r3 = q("ALTER TABLE item add summary TEXT NOT NULL"); + $r2 = q("create index \"uuid_idx\" on item (\"uuid\")"); + $r3 = q("ALTER TABLE item add summary TEXT NOT NULL DEFAULT ''"); $r = ($r1 && $r2 && $r3); } -- cgit v1.2.3 From 6b02c664fb9444d66322605c408bb791457ee0b5 Mon Sep 17 00:00:00 2001 From: "M. Dent" Date: Sun, 25 Nov 2018 10:22:09 +0100 Subject: Do not store serialized pconfig value received via to Module/Pconfig.php --- Zotlabs/Module/Pconfig.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Pconfig.php b/Zotlabs/Module/Pconfig.php index 44fe5d9a9..f31d5fdf6 100644 --- a/Zotlabs/Module/Pconfig.php +++ b/Zotlabs/Module/Pconfig.php @@ -22,6 +22,11 @@ class Pconfig extends \Zotlabs\Web\Controller { $k = trim(escape_tags($_POST['k'])); $v = trim($_POST['v']); $aj = intval($_POST['aj']); + + // Do not store "serialized" data received in the $_POST + if (preg_match('|^a:[0-9]+:{.*}$|s',$v) || preg_match('O:8:"stdClass":[0-9]+:{.*}$|s',$v)) { + return; + } if(in_array(argv(2),$this->disallowed_pconfig())) { notice( t('This setting requires special processing and editing has been blocked.') . EOL); -- cgit v1.2.3 From bd10d48338ef7465d186b44c0982b81503ac861b Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 10:36:56 +0100 Subject: Update database with expires field for photo --- Zotlabs/Update/_1229.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Zotlabs/Update/_1229.php (limited to 'Zotlabs') diff --git a/Zotlabs/Update/_1229.php b/Zotlabs/Update/_1229.php new file mode 100644 index 000000000..8e8711644 --- /dev/null +++ b/Zotlabs/Update/_1229.php @@ -0,0 +1,32 @@ + Date: Thu, 29 Nov 2018 10:37:39 +0100 Subject: Add photo cache cleanup --- Zotlabs/Daemon/Cron.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php index 25e49b817..8b6b42c8a 100644 --- a/Zotlabs/Daemon/Cron.php +++ b/Zotlabs/Daemon/Cron.php @@ -94,6 +94,29 @@ class Cron { @time_sleep_until(microtime(true) + (float) $interval); } } + + // Clean expired photos from cache + + $age = get_config('system','active_expire_days', '30'); + $r = q("SELECT DISTINCT xchan, content FROM photo WHERE photo_usage = %d AND expires < %s - INTERVAL %s", + intval(PHOTO_CACHE), + db_utcnow(), + db_quoteinterval($age . ' DAY') + ); + if($r) { + foreach($r as $rr) { + $file = dbunescbin($rr['content']); + if(is_file($file)) { + @unlink($file); + logger('info: deleted cached photo file ' . $file, LOGGER_DEBUG); + } + } + } + q("DELETE FROM photo WHERE photo_usage = %d AND expires < %s - INTERVAL %s", + intval(PHOTO_CACHE), + db_utcnow(), + db_quoteinterval($age . ' DAY') + ); // publish any applicable items that were set to be published in the future // (time travel posts). Restrict to items that have come of age in the last -- cgit v1.2.3 From bd0fc8a2d7f71e9b9d6fa768fa30484bcb7e22f2 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 10:38:25 +0100 Subject: Add photo cache hooks --- Zotlabs/Module/Photo.php | 90 ++++++++++++++++++++++++++++++------------------ 1 file changed, 57 insertions(+), 33 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 30e8340e2..55e92ca04 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -1,19 +1,19 @@ false, // Cache off + 'age' => 86400, // max-age + 'exp' => true, // Use own max-age + 'leak' => false // Do not allow non members use our cache + ); + call_hooks('cache_mode_hook', $cache_mode); + $observer_xchan = get_observer_hash(); $ismodified = $_SERVER['HTTP_IF_MODIFIED_SINCE']; @@ -106,13 +114,14 @@ class Photo extends \Zotlabs\Web\Controller { License link: http://creativecommons.org/licenses/by/3.0/ */ + // @FIXME It seems this part doesn't work because we are not setting such cookie $cookie_value = false; if (isset($_COOKIE['devicePixelRatio'])) { $cookie_value = intval($_COOKIE['devicePixelRatio']); } else { // Force revalidation of cache on next request - $cache_directive = 'no-cache'; + // $prvcachecontrol = 'no-cache'; $status = 'no cookie'; } @@ -129,27 +138,44 @@ class Photo extends \Zotlabs\Web\Controller { $resolution = 1; } - $r = q("SELECT uid, photo_usage FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1", + $r = q("SELECT uid, photo_usage, expires, display_path FROM photo WHERE resource_id = '%s' AND imgscale = %d LIMIT 1", dbesc($photo), intval($resolution) ); if($r) { - $allowed = (-1); - if(intval($r[0]['photo_usage'])) { + $u = intval($r[0]['photo_usage']); + if($u) { $allowed = 1; - if(intval($r[0]['photo_usage']) === PHOTO_COVER) + if($u === PHOTO_COVER) if($resolution < PHOTO_RES_COVER_1200) $allowed = (-1); - if(intval($r[0]['photo_usage']) === PHOTO_PROFILE) + if($u === PHOTO_PROFILE) if(! in_array($resolution,[4,5,6])) $allowed = (-1); + if($u === PHOTO_CACHE) { + $origurl = $r[0]['display_path']; + // Cached image leak protection + if(! (local_channel() || $cache_mode['leak'])) { + header("Location: " . $origurl); + killme(); + } + // Revalidate cache + if($cache_mode['on'] && strtotime($r[0]['expires']) - 60 < time()) { + $cache = array( + 'url' => $origurl, + 'uid' => $r[0]['uid'] + ); + call_hooks('cache_url_hook', $cache); + if(! $cache['status']) + http_status_exit(404,'not found'); + } + } } - if($allowed === (-1)) { + if($allowed === (-1)) $allowed = attach_can_view($r[0]['uid'],$observer_xchan,$photo); - } $channel = channelx_by_n($r[0]['uid']); @@ -160,16 +186,19 @@ class Photo extends \Zotlabs\Web\Controller { ); $exists = (($e) ? true : false); - + if($exists && $allowed) { + $expires = strtotime($e[0]['expires'] . 'Z'); $data = dbunescbin($e[0]['content']); $filesize = $e[0]['filesize']; $mimetype = $e[0]['mimetype']; $modified = strtotime($e[0]['edited'] . 'Z'); - if(intval($e[0]['os_storage'])) + + if(intval($e[0]['os_storage'])) { $streaming = $data; + } if($e[0]['allow_cid'] != '' || $e[0]['allow_gid'] != '' || $e[0]['deny_gid'] != '' || $e[0]['deny_gid'] != '') - $prvcachecontrol = true; + $prvcachecontrol = 'no-store, no-cache, must-revalidate'; } else { if(! $allowed) { @@ -180,9 +209,9 @@ class Photo extends \Zotlabs\Web\Controller { } } - } else { + } + else http_status_exit(404,'not found'); - } } header_remove('Pragma'); @@ -225,24 +254,14 @@ class Photo extends \Zotlabs\Web\Controller { $mimetype = $ph->getType(); } } - - // @FIXME Seems never invoked - // Writing in cachefile - if (isset($cachefile) && $cachefile != '') { - file_put_contents($cachefile, $data); - $modified = filemtime($cachefile); - } - - header("Content-type: " . $mimetype); - - if($prvcachecontrol) { + if(isset($prvcachecontrol)) { // it is a private photo that they have no permission to view. // tell the browser not to cache it, in case they authenticate // and subsequently have permission to see it - header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: " . $prvcachecontrol); } else { @@ -255,18 +274,23 @@ class Photo extends \Zotlabs\Web\Controller { // This has performance considerations but we highly recommend you // leave it alone. - $cache = get_config('system','photo_cache_time', 86400); // 1 day by default + $maxage = $cache_mode['age']; - header("Expires: " . gmdate("D, d M Y H:i:s", time() + $cache) . " GMT"); - header("Cache-Control: max-age=" . $cache); + if($cache_mode['exp'] || (! isset($expires)) || (isset($expires) && $expires - 60 < time())) + $expires = time() + $maxage; + else + $maxage = $expires - time(); + + header("Expires: " . gmdate("D, d M Y H:i:s", $expires) . " GMT"); + header("Cache-Control: max-age=" . $maxage); } + header("Content-type: " . $mimetype); header("Last-Modified: " . gmdate("D, d M Y H:i:s", $modified) . " GMT"); header("Content-Length: " . (isset($filesize) ? $filesize : strlen($data))); // If it's a file resource, stream it. - if($streaming && $channel) { if(strpos($streaming,'store') !== false) $istream = fopen($streaming,'rb'); -- cgit v1.2.3 From 6aa99a903fd221d306c62a807cf3c1a4564f0b4d Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 11:56:56 +0100 Subject: Code cleanup --- Zotlabs/Module/Photo.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 55e92ca04..b8d1c36f2 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -5,6 +5,7 @@ namespace Zotlabs\Module; require_once('include/security.php'); require_once('include/attach.php'); +require_once('include/photo/photo_driver.php'); class Photo extends \Zotlabs\Web\Controller { @@ -155,16 +156,15 @@ class Photo extends \Zotlabs\Web\Controller { if(! in_array($resolution,[4,5,6])) $allowed = (-1); if($u === PHOTO_CACHE) { - $origurl = $r[0]['display_path']; // Cached image leak protection if(! (local_channel() || $cache_mode['leak'])) { - header("Location: " . $origurl); + header("Location: " . $r[0]['display_path']); killme(); } // Revalidate cache if($cache_mode['on'] && strtotime($r[0]['expires']) - 60 < time()) { $cache = array( - 'url' => $origurl, + 'url' => $r[0]['display_path'], 'uid' => $r[0]['uid'] ); call_hooks('cache_url_hook', $cache); -- cgit v1.2.3 From f3831fa77fe62d8696f867259ae9f007a0a3d2ea Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 29 Nov 2018 21:27:06 +0100 Subject: Better cache settings logic --- Zotlabs/Module/Photo.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index b8d1c36f2..d85db7307 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -32,10 +32,10 @@ class Photo extends \Zotlabs\Web\Controller { } $cache_mode = array( - 'on' => false, // Cache off - 'age' => 86400, // max-age - 'exp' => true, // Use own max-age - 'leak' => false // Do not allow non members use our cache + 'on' => get_config('system','photo_cache_enable', 0), + 'age' => 86400, + 'exp' => true, + 'leak' => false ); call_hooks('cache_mode_hook', $cache_mode); -- cgit v1.2.3 From 237c6eed5024d2507630f2321218685b3540c957 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 2 Dec 2018 10:38:13 +0000 Subject: fallback to url if we have not got an addr (cherry picked from commit a3ba7f0788705a6ebee57433e80712b282b0e784) --- Zotlabs/Lib/Enotify.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index 523ccf93a..5e5798cac 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -828,7 +828,7 @@ class Enotify { $x = array( 'notify_link' => $item['llink'], 'name' => $item['author']['xchan_name'], - 'addr' => $item['author']['xchan_addr'], + 'addr' => (($item['author']['xchan_addr']) ? $item['author']['xchan_addr'] : $item['author']['xchan_url']), 'url' => $item['author']['xchan_url'], 'photo' => $item['author']['xchan_photo_s'], 'when' => relative_date(($edit)? $item['edited'] : $item['created']), -- cgit v1.2.3 From c50e3a702aa93cc9fde1380e8addaeb62e4139b2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 3 Dec 2018 09:46:49 +0000 Subject: more notifications fixes (cherry picked from commit 9ef6c57ca59aa318a3564f6b48c6442870650d3e) --- Zotlabs/Widget/Notifications.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index 0f9f609e4..37d9139ec 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -24,7 +24,7 @@ class Notifications { ], 'filter' => [ 'posts_label' => t('Show new posts only'), - 'name_label' => t('Filter by name') + 'name_label' => t('Filter by name or address') ] ]; @@ -43,7 +43,7 @@ class Notifications { ], 'filter' => [ 'posts_label' => t('Show new posts only'), - 'name_label' => t('Filter by name') + 'name_label' => t('Filter by name or address') ] ]; @@ -119,7 +119,7 @@ class Notifications { 'label' => t('Forums'), 'title' => t('Forums'), 'filter' => [ - 'name_label' => t('Filter by name') + 'name_label' => t('Filter by name or address') ] ]; } @@ -150,7 +150,7 @@ class Notifications { ], 'filter' => [ 'posts_label' => t('Show new posts only'), - 'name_label' => t('Filter by name') + 'name_label' => t('Filter by name or address') ] ]; } -- cgit v1.2.3