Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
FIX: Sanitize and bind command configuration queries 21.10.x (#11755)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyahiaoui-ext authored Sep 13, 2022
1 parent 095dda9 commit 36c0f9a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions www/include/common/javascript/commandGetArgs/cmdGetExample.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,14 @@ function myDecodeService($arg)
exit();
}

$DBRESULT = $pearDB->query(
"SELECT `command_example` FROM `command` WHERE `command_id` = '". $pearDB->escape($_POST["index"]) ."'"
$statement = $pearDB->prepare(
"SELECT `command_example` FROM `command` WHERE `command_id` = :command_id"
);
while ($arg = $DBRESULT->fetchRow()) {
$statement->bindValue(':command_id', (int) $_POST["index"], \PDO::PARAM_INT);
$statement->execute();
while ($arg = $statement->fetch(\PDO::FETCH_ASSOC)) {
echo myDecodeService($arg["command_example"]);
}
unset($arg);
unset($DBRESULT);
unset($arg, $statement);
$pearDB = null;
}

0 comments on commit 36c0f9a

Please sign in to comment.