From e89f42d4665fef4a003a415353e2ecb6b2a8c017 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Wed, 23 Mar 2011 13:35:35 +0100 Subject: [PATCH] Set MySQL time zone by PHP setting only in Editor --- adminer/drivers/mysql.inc.php | 1 - changes.txt | 2 +- editor/include/adminer.inc.php | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index b73379ab..ba8359ce 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -251,7 +251,6 @@ if (!defined("DRIVER")) { $credentials = $adminer->credentials(); if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) { $connection->query("SET sql_quote_show_create = 1"); - $connection->query("SET time_zone = " . $connection->quote(substr_replace(@date("O"), ":", -2, 0))); // date("P") available since PHP 5.1.3, @ - requires date.timezone since PHP 5.3.0 return $connection; } return $connection->error; diff --git a/changes.txt b/changes.txt index 788178fc..9600f61e 100644 --- a/changes.txt +++ b/changes.txt @@ -10,12 +10,12 @@ Parse UTF-16 and UTF-8 BOM in all text uploads Display ; in history (thanks to Jan Cerny) Use DELIMITER in history Show databases even with skip_show_database in MySQL 5 (thanks to Radoslaw Kowalewski) -Set MySQL time zone by PHP setting Disable maxlength with functions in edit Better placement of AJAX icon Table header in CSV export (Editor) Time format hint (Editor) Respect order after search (Editor) +Set MySQL time zone by PHP setting (Editor) Allow own code in (customization) Polish translation diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 030e73f3..0ac51da5 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -50,6 +50,8 @@ document.getElementById('username').focus(); } function login($login, $password) { + global $connection; + $connection->query("SET time_zone = " . q(substr_replace(@date("O"), ":", -2, 0))); // date("P") available since PHP 5.1.3, @ - requires date.timezone since PHP 5.3.0 return true; }