Skip to content

Commit

Permalink
FIX: #12
Browse files Browse the repository at this point in the history
  • Loading branch information
drosanda committed Nov 15, 2021
1 parent f8d0cbb commit 1b86153
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions kero/sine/SENE_MySQLi_Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -1240,13 +1240,15 @@ public function insert($table, $datas=array(), $multi_array=0, $is_debug=0)
$sql .= ') VALUES(';

foreach ($datas as $key=>$val) {
if ($val=='NOW()' || $val=='now()') {
$sql .=''.$val.',';
} elseif (strtolower($val)=='null') {
$sql .='NULL,';
} else {
$sql .=''.$this->esc($val).',';
}
if ($val=='NOW()' || $val=='now()') {
$sql .=''.$val.',';
} else if (strtolower($val)=='null') {
$sql .='NULL,';
} else if (stripos($val, "AES_ENCRYPT(") !== false || stripos($val, "AES_DECRYPT(") !== false) {
$sql .= $val.',';
} else {
$sql .=''.$this->esc($val).',';
}
}
$sql = rtrim($sql, ',');
$sql .= ');';
Expand All @@ -1272,6 +1274,8 @@ public function update($table, $datas=array(), $is_debug=0)
foreach ($datas as $key=>$val) {
if ($val=='now()' || $val=='NOW()' || $val=="NULL" || $val=='null') {
$sql .='`'.$key.'` = '.$val.',';
} else if (stripos($val, "AES_ENCRYPT(") !== false || stripos($val, "AES_DECRYPT(") !== false) {
$sql .= $val.',';
} else {
$sql .='`'.$key.'` = '.$this->esc($val).',';
}
Expand Down

0 comments on commit 1b86153

Please # to comment.