fix(Attach.php): Trying to access array offset on value of type null (#2075)

This commit is contained in:
Roman Kelesidis 2025-08-06 10:16:48 +03:00 committed by GitHub
commit abb2b242b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)) {