Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Desportes <williamdes@wdes.fr>2019-12-22 01:36:41 +0300
committerWilliam Desportes <williamdes@wdes.fr>2019-12-22 01:36:58 +0300
commit823aad9ad6d7f2528a5424a0b11193858d79ef6d (patch)
tree69c141b08200abbe60e8996ce163187131f5d502
parentba570e102dd8229b79e4c5608234b2934e5fc781 (diff)
Fix #15614 - Undefined offset on index page for MySQL 5.7.8
Signed-off-by: William Desportes <williamdes@wdes.fr>
-rw-r--r--index.php2
-rw-r--r--libraries/classes/Charsets.php6
2 files changed, 6 insertions, 2 deletions
diff --git a/index.php b/index.php
index ef2764769b..9ed6010624 100644
--- a/index.php
+++ b/index.php
@@ -376,7 +376,7 @@ if ($server > 0 && $GLOBALS['cfg']['ShowServerInfo']) {
$GLOBALS['cfg']['Server']['DisableIS']
);
- echo ' ' , $charsets[$charset], ' (' . $charset, ')';
+ echo ' ' , (isset($charsets[$charset]) ? $charsets[$charset] : '') , ' (' . $charset, ')';
echo ' </span>'
. ' </li>'
. ' </ul>'
diff --git a/libraries/classes/Charsets.php b/libraries/classes/Charsets.php
index cfb6cb832b..38c90f129f 100644
--- a/libraries/classes/Charsets.php
+++ b/libraries/classes/Charsets.php
@@ -147,7 +147,11 @@ class Charsets
if (self::$_charset_server) {
return self::$_charset_server;
} else {
- self::$_charset_server = $dbi->getVariable('character_set_server');
+ $charsetServer = $dbi->getVariable('character_set_server');
+ if (! is_string($charsetServer)) {// MySQL 5.7.8 fallback, issue #15614
+ $charsetServer = $dbi->fetchValue("SELECT @@character_set_server;");
+ }
+ self::$_charset_server = $charsetServer;
return self::$_charset_server;
}
}