8000 Update ssql.php · ratajs/SuperSQL@1922c5f · GitHub
[go: up one dir, main page]

Skip to content

Commit 1922c5f

Browse files
authored
Update ssql.php
1 parent 21a5b59 commit 1922c5f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ssql.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ public function insert(string $table, array $values, int $flags = 0, string $nam
421421
if($key!=array_keys($values, array_values($values)[0])[0]) $valueString.= ", ";
422422
if($value===NULL)
423423
$valueString.= "NULL";
424-
elseif(preg_match("/^[\x{0020}-\x{007E}\x{00A0}-ſ]*$/", $value) && !preg_match("/\x{0027}/", $esc = $this->escape($v3)))
424+
elseif(preg_match("/^[\x{0020}-\x{007E}\x{00A0}-ſ]*$/", $value) && !preg_match("/\[x{0027}\x{005C}]/", $value))
425425
$valueString.= "'" . $this->escape($value) . "'";
426426
elseif($this->SQLite)
427427
$valueString.= "x'" . bin2hex($value) . "'";
@@ -452,7 +452,7 @@ public function update(string $table, $cond, array $values, int $flags = 128, st
452452
$string.= "`" . $this->escape($key) . "`=";
453453
if($value===NULL)
454454
$string.= "NULL";
455-
elseif(preg_match("/^[\x{0020}-\x{007E}\x{00A0}-ſ]*$/", $value) && !preg_match("/\x{0027}/", $esc = $this->escape($v3)))
455+
elseif(preg_match("/^[\x{0020}-\x{007E}\x{00A0}-ſ]*$/", $value) && !preg_match("/[\x{0027}\x{005C}]/", $value))
456456
$string.= "'" . $this->escape($value) . "'";
457457
elseif($this->SQLite)
458458
$string.= "x'" . bin2hex($value) . "'";
@@ -683,8 +683,8 @@ private function getCondString($a, bool $and, bool $on = false) {
683683
$r.= "`" . $this->escape($v3) . "`";
684684
elseif($value===NULL)
685685
$r.= "NULL";
686-
elseif(preg_match("/^[\x{0020}-\x{007E}\x{00A0}-ſ]*$/", $v3) && !preg_match("/\x{0027}/", $esc = $this->escape($v3)))
687-
$r.= "'{$esc}'";
686+
elseif(preg_match("/^[\x{0020}-\x{007E}\x{00A0}-ſ]*$/", $v3) && !preg_match("/[\x{0027}\x{005C}]/", $v3))
687+
$r.= "'" . $this- DBA6 >escape($v3) . "'";
688688
elseif($this->SQLite)
689689
$r.= "x'" . bin2hex($v3) . "'";
690690
else
@@ -715,8 +715,8 @@ private function getCondString($a, bool $and, bool $on = false) {
715715
$r.= "`" . $this->escape($v) . "`";
716716
elseif($v===NULL)
717717
$r.= "NULL";
718-
elseif(preg_match("/^[\x{0020}-\x{007E}\x{00A0}-ſ]*$/", $v) && !preg_match("/\x{0027}/", $esc = $this->escape($v)))
719-
$r.= "'{$esc}'";
718+
elseif(preg_match("/^[\x{0020}-\x{007E}\x{00A0}-ſ]*$/", $v) && !preg_match("/[\x{0027}\x{005C}]/", $v))
719+
$r.= "'" . $this->escape($v) . "'";
720720
elseif($this->SQLite)
721721
$r.= "x'" . bin2hex($v) . "'";
722722
else
@@ -932,8 +932,8 @@ public function quote($v) {
932932
return $v;
933933
elseif($v===NULL)
934934
return "NULL";
935-
elseif(preg_match("/^[\x{0020}-\x{007E}\x{00A0}-ſ]*$/", $v) && !preg_match("/\x{0027}/", $esc = $this->c->escape($v)))
936-
return "'{$esc}'";
935+
elseif(preg_match("/^[\x{0020}-\x{007E}\x{00A0}-ſ]*$/", $v) && !preg_match("/[\x{0027}\x{005C}]/", $v))
936+
return "'" . $this->c->escape($v) . "'";
937937
elseif($this->c->SQLite)
938938
return "x'" . bin2hex($v) . "'";
939939
else

0 commit comments

Comments
 (0)
0