Skip to content

Commit

Permalink
Fixes missing $pm['options'] when sending pms in reporting contents…
Browse files Browse the repository at this point in the history
…, which results in PHP fatal error of uncaught TypeError: Argument #2 ($array) must be of type array, null given in `array_key_exists()` in `/inc/datahandler.php` (L207).
  • Loading branch information
yuliu committed Dec 22, 2022
1 parent 2fd725f commit 64e8476
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions inc/functions_modcp.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,14 @@ function send_report($report, $report_type='post')
"ipaddress" => $mybb->session->packedip
);

$pm['options'] = array(
"signature" => 0,
"disablesmilies" => 0,
"savecopy" => 0,
"readreceipt" => 0
);
$pm['saveasdraft'] = 0;

$pmhandler->admin_override = true;
$pmhandler->set_data($pm);

Expand Down

0 comments on commit 64e8476

Please sign in to comment.