From b55f314d7ee1c1cc00f13a8602a56780e1db71ae Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 11 Sep 2022 18:26:27 +0000 Subject: php8: fix warnings --- include/photo/photo_driver.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index b7ace4f37..3fced76f2 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -85,6 +85,10 @@ function guess_image_type($filename, $data = '') { $hdrs = []; $h = explode("\n", $headers); foreach ($h as $l) { + if (strpos($l, ':') === false) { + continue; + } + list($k, $v) = array_map('trim', explode(':', trim($l), 2)); $hdrs[strtolower($k)] = $v; } @@ -251,6 +255,10 @@ function import_xchan_photo($photo, $xchan, $thing = false, $force = false) { $hdrs = []; $h = explode("\n", $result['header']); foreach ($h as $l) { + if (strpos($l, ':') === false) { + continue; + } + list($t,$v) = array_map("trim", explode(":", trim($l), 2)); $hdrs[strtolower($t)] = $v; } -- cgit v1.2.3