From c1d31602810a7d71bdf6496281532e305c4c34e1 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 6 Aug 2025 10:08:12 +0300 Subject: [PATCH] fix(Attach.php): Trying to access array offset on value of type null --- src/Legacy/Attach.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Legacy/Attach.php b/src/Legacy/Attach.php index cd9ca32d2..ae0eefedc 100644 --- a/src/Legacy/Attach.php +++ b/src/Legacy/Attach.php @@ -788,9 +788,10 @@ class Attach } DB()->sql_freeresult($result); - $allowed_filesize = $row['max_filesize'] ?: $attach_config['max_filesize']; - $cat_id = (int)$row['cat_id']; - $auth_cache = trim($row['forum_permissions']); + $allowed_filesize = $row['max_filesize'] ?? $attach_config['max_filesize']; + $cat_id = isset($row['cat_id']) ? (int)$row['cat_id'] : 0; + $auth_cache = isset($row['forum_permissions']) ? trim($row['forum_permissions']) : ''; + $row['allow_group'] = $row['allow_group'] ?? 0; // check Filename if (preg_match("#[\\/:*?\"<>|]#i", $this->filename)) {