This commit is contained in:
2023-10-05 15:15:50 +08:00
parent 0dd7b7e0e7
commit d942db93d8
+2 -3
View File
@@ -208,7 +208,6 @@ class BackupCommand extends Command
{
$strings = ['INSERT INTO ' . $dbname . '.' . $value];
foreach ($data as $datum) {
if (count($strings) == 1) {
$keys = array_keys($datum);
$strings[] = '(' . implode(',', $keys) . ') VALUES';
@@ -217,9 +216,9 @@ class BackupCommand extends Command
$encode = [];
foreach ($keys as $val) {
if (is_string($val)) {
$encode[] = '\'' . htmlentities($val) . '\'';
$encode[] = '\'' . addcslashes($val,'\'') . '\'';
} else {
$encode[] = $val;
$encode[] = $val === '' ? '\'\'' : $val;
}
}
$strings[] = '(' . implode(',', $encode) . '),';