Skip to content

Commit

Permalink
Fix #15614 - Undefined offset on index page for MySQL 5.7.8
Browse files Browse the repository at this point in the history
Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Dec 21, 2019
1 parent ba570e1 commit 823aad9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -376,7 +376,7 @@
$GLOBALS['cfg']['Server']['DisableIS']
);

echo ' ' , $charsets[$charset], ' (' . $charset, ')';
echo ' ' , (isset($charsets[$charset]) ? $charsets[$charset] : '') , ' (' . $charset, ')';
echo ' </span>'
. ' </li>'
. ' </ul>'
Expand Down
6 changes: 5 additions & 1 deletion libraries/classes/Charsets.php
Expand Up @@ -147,7 +147,11 @@ public static function getServerCharset(DatabaseInterface $dbi)
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;
}
}
Expand Down

0 comments on commit 823aad9

Please sign in to comment.