Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PM plugin - fatal error if user is not allowed to add attachment #5025

Closed
Jimmi08 opened this issue Jun 30, 2023 · 0 comments · Fixed by #5027
Closed

PM plugin - fatal error if user is not allowed to add attachment #5025

Jimmi08 opened this issue Jun 30, 2023 · 0 comments · Fixed by #5027
Labels
plugin: pm type: bug A problem that should not be happening

Comments

@Jimmi08
Copy link
Contributor

Jimmi08 commented Jun 30, 2023

Bug Description

$this->pmPrefs['attach_class'] has value 254

A normal user doesn't see this field thanks this check:
if (isset($this->pmPrefs['attach_class']) && check_class($this->pmPrefs['attach_class']))

BUT in PHP 8.2. it fails on
foreach (array_keys($_FILES['file_userfile']['size']) as $fid)
because value is NULL and not array

Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in ***plugins\pm\pm.php on line 618

Thanks

@Jimmi08 Jimmi08 added the type: bug A problem that should not be happening label Jun 30, 2023
@Moc Moc added the plugin: pm label Jul 1, 2023
CaMer0n added a commit that referenced this issue Jul 10, 2023
Fixes #5025: Type error when sending a PM without the attachment field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: pm type: bug A problem that should not be happening
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants