Skip to content

Commit

Permalink
修复 NULL 字符问题
Browse files Browse the repository at this point in the history
修复 `NULL` 字符问题
  • Loading branch information
JZaaa authored Jun 18, 2019
1 parent 5cb5ef8 commit 4cc83ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Lib/CakeBackup.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ private function _tableData($table) {
$sql .= $bracket;
$temp = '';
foreach ($columns as $value) {
$sql .= ($temp . "'" . htmlspecialchars_decode(stripcslashes(($item[$value])), ENT_QUOTES) . "'");
$val = is_null($item[$value]) ? "null" : "'" . htmlspecialchars_decode(stripcslashes(($item[$value])), ENT_QUOTES) . "'";
$sql .= $temp . $val;
$temp = ',';
}
$sql .= ')';
Expand All @@ -330,4 +331,4 @@ private function _tableData($table) {
}


}
}

0 comments on commit 4cc83ec

Please sign in to comment.