From 1a15c775f8b7b5f19ba7ba68730f31a20da402b5 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 24 Mar 2021 09:21:58 +0000 Subject: php8: fix fatal errors --- include/text.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/text.php b/include/text.php index 9635925b5..c6980c5f8 100644 --- a/include/text.php +++ b/include/text.php @@ -3751,6 +3751,9 @@ function get_forum_channels($uid) { intval($uid) ); + if(!$r) + $r = []; + for($x = 0; $x < count($r); $x ++) { if($x3) { foreach($x3 as $xx) { -- cgit v1.2.3 From 3d4ad94dccd3f3b0ee7b77408ca1c293b30fd922 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 24 Mar 2021 11:16:03 +0000 Subject: Revalidate imported profile photo on each request (patch provided by Max) --- include/photo/photo_driver.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 8de5185af..256369c69 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -239,7 +239,7 @@ function import_xchan_photo($photo, $xchan, $thing = false, $force = false) { if($force || empty($modified)) $result = z_fetch_url($photo, true); - elseif($exp - 60 < time()) { + else { $h = []; $h[] = "If-Modified-Since: " . gmdate("D, d M Y H:i:s", $exp) . " GMT"; if(! empty($etag)) @@ -247,6 +247,7 @@ function import_xchan_photo($photo, $xchan, $thing = false, $force = false) { $result = z_fetch_url($photo, true, 0, [ 'headers' => $h ]); } + if(isset($result)) { $hdrs = []; $h = explode("\n", $result['header']); -- cgit v1.2.3