File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,7 +73,20 @@ function_requirements('abuse_admin');
7373 $ db ->next_record (MYSQL_ASSOC );
7474 if (!is_null ($ db ->Record ['abuse_attachments ' ])) {
7575 $ decoded = json_decode ($ db ->Record ['abuse_attachments ' ], true );
76- $ db ->Record ['abuse_attachments ' ] = is_array ($ decoded ) ? array_values (array_filter ($ decoded , 'is_array ' )) : null ;
76+ if (is_array ($ decoded )) {
77+ // Filter to keep only array values that have required attachment keys
78+ $ db ->Record ['abuse_attachments ' ] = [];
79+ foreach ($ decoded as $ idx => $ item ) {
80+ if (is_array ($ item ) && isset ($ item ['contentType ' ]) || isset ($ item ['filename ' ]) || isset ($ item ['content ' ])) {
81+ $ db ->Record ['abuse_attachments ' ][] = $ item ;
82+ }
83+ }
84+ if (empty ($ db ->Record ['abuse_attachments ' ])) {
85+ $ db ->Record ['abuse_attachments ' ] = null ;
86+ }
87+ } else {
88+ $ db ->Record ['abuse_attachments ' ] = null ;
89+ }
7790 }
7891 $ ip = $ db ->Record ['abuse_ip ' ];
7992 $ server_data = get_server_from_ip ($ ip );
You can’t perform that action at this time.
0 commit comments