From 8db0b3acf6a5620ec0ea1fcdc27ff74e49f20997 Mon Sep 17 00:00:00 2001 From: eldadfux Date: Wed, 13 Nov 2019 00:39:07 +0200 Subject: [PATCH] Better error handling --- app/controllers/avatars.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/avatars.php b/app/controllers/avatars.php index 432fd0c62c..8015489c87 100644 --- a/app/controllers/avatars.php +++ b/app/controllers/avatars.php @@ -43,7 +43,7 @@ $avatarCallback = function ($type, $code, $width, $height, $quality) use ($types $path = $types[$type][$code]; $type = 'png'; - if (!file_exists($path)) { + if (!is_readable($path)) { throw new Exception('File not found in '.$path, 404); }