Skip to content
Permalink
Browse files Browse the repository at this point in the history
[enh] add SQL-Injection protection
  • Loading branch information
pointhi committed Dec 19, 2014
1 parent 49f1598 commit 281bd67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cgi/cron.php
Expand Up @@ -94,10 +94,10 @@

// save in database
$query = "UPDATE `#instances` SET ".
"`VERSION_STRING` = '".$res_searx_version."', ".
"`RETURN_CODE` = '".$res_http_code."', ".
"`VERSION_STRING` = '".DatabaseManager::correctString($res_searx_version)."', ".
"`RETURN_CODE` = '".(int)$res_http_code."', ".
"`LAST_UPDATE` = '".date('Y-m-d H:i:s',$res_timestamp)."' ".
"WHERE `#instances`.`ID` =".$single_instance['id'].";";
"WHERE `#instances`.`ID` =".(int)$single_instance['id'].";";
$DatabaseHandler->query($query);

// print result
Expand Down Expand Up @@ -174,7 +174,7 @@
$query = "UPDATE `#engines` SET ".
"`IS_WORKING` = '".(int)$res_success."', ".
"`LAST_UPDATE` = '".date('Y-m-d H:i:s',$res_timestamp)."' ".
"WHERE `#engines`.`ID` =".$single_engine['id'].";";
"WHERE `#engines`.`ID` =".(int)$single_engine['id'].";";
$DatabaseHandler->query($query);

if($res_success)
Expand Down

0 comments on commit 281bd67

Please sign in to comment.