From 823aad9ad6d7f2528a5424a0b11193858d79ef6d Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sat, 21 Dec 2019 23:36:41 +0100 Subject: [PATCH] Fix #15614 - Undefined offset on index page for MySQL 5.7.8 Signed-off-by: William Desportes --- index.php | 2 +- libraries/classes/Charsets.php | 6 +++++- 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 ' ' . ' ' . ' ' 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; } } -- 2.11.4.GIT