1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-13 18:14:07 +02:00

MS SQL: Prefix Unicode strings with 'N' so they are treated correctly

This commit is contained in:
HyP3r
2022-03-18 21:08:25 +01:00
committed by Jakub Vrana
parent 81530227c2
commit 4bc9a29f3e

View File

@@ -40,7 +40,8 @@ if (isset($_GET["mssql"])) {
} }
function quote($string) { function quote($string) {
return "'" . str_replace("'", "''", $string) . "'"; $unicode = strlen($string) != strlen(utf8_decode($string));
return ($unicode ? "N" : "") . "'" . str_replace("'", "''", $string) . "'";
} }
function select_db($database) { function select_db($database) {
@@ -163,7 +164,8 @@ if (isset($_GET["mssql"])) {
} }
function quote($string) { function quote($string) {
return "'" . str_replace("'", "''", $string) . "'"; $unicode = strlen($string) != strlen(utf8_decode($string));
return ($unicode ? "N" : "") . "'" . str_replace("'", "''", $string) . "'";
} }
function select_db($database) { function select_db($database) {