]> git.joonet.de Git - adminer.git/commitdiff
Use $connection->result
authorJakub Vrana <jakub@vrana.cz>
Sun, 23 Feb 2025 13:27:57 +0000 (14:27 +0100)
committerJakub Vrana <jakub@vrana.cz>
Sun, 23 Feb 2025 13:39:13 +0000 (14:39 +0100)
adminer/drivers/mysql.inc.php
adminer/drivers/pgsql.inc.php

index d3d527260e270eae4e95f9a272ce45ecc0b3175f..61b1699ab73929b374c8a040341e8d39ff9e6616 100644 (file)
@@ -1066,14 +1066,15 @@ if (!defined("DRIVER")) {
                return get_key_vals("SHOW VARIABLES");
        }
 
-       /** Checks if C-style escapes are supported
+       /** Check if C-style escapes are supported
        * @return bool
        */
        function is_c_style_escapes() {
-               static $c_style = null;
+               global $connection;
+               static $c_style;
                if ($c_style === null) {
-                       $variables = get_key_vals("SHOW VARIABLES LIKE 'sql_mode'");
-                       $c_style = strpos($variables["sql_mode"], 'NO_BACKSLASH_ESCAPES') === false;
+                       $sql_mode = $connection->result("SHOW VARIABLES LIKE 'sql_mode'", 1);
+                       $c_style = (strpos($sql_mode, 'NO_BACKSLASH_ESCAPES') === false);
                }
                return $c_style;
        }
index 77cfc418a666e5c07f85715e18c19c2e08d14437..7c880bdfb52423c7369eb8be38f02c7660ec7a60 100644 (file)
@@ -888,10 +888,10 @@ AND typelem = 0"
        }
 
        function is_c_style_escapes() {
-               static $c_style = null;
+               global $connection;
+               static $c_style;
                if ($c_style === null) {
-                       $vals = get_vals("SHOW standard_conforming_strings");
-                       $c_style = $vals[0] == "off";
+                       $c_style = ($connection->result("SHOW standard_conforming_strings") == "off");
                }
                return $c_style;
        }