Skip to content

Commit aa5c4a3

Browse files
committed
fix: sanitizzazione per prevenire sql injection
1 parent b1a0f2c commit aa5c4a3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

actions.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,12 @@
178178

179179
// Zip allegati
180180
elseif (filter('op') == 'download-zip-allegati') {
181-
$rs = $dbo->fetchArray('SELECT * FROM zz_files WHERE id_module='.prepare($id_module).' AND id IN('.implode(',', json_decode(filter('id'))).')');
181+
$ids = json_decode(filter('id'), true);
182+
if (!is_array($ids)) {
183+
$ids = [];
184+
}
185+
$ids = array_map('intval', $ids);
186+
$rs = $dbo->fetchArray('SELECT * FROM zz_files WHERE id_module='.prepare($id_module).' AND id IN('.implode(',', array_map('prepare', $ids)).')');
182187

183188
$dir = base_dir().'/'.$module->upload_directory;
184189
directory($dir.'tmp/');

0 commit comments

Comments
 (0)