From 4a6b6bda90d35fb9b9462db713b45b4f8325ff02 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 26 Jul 2013 08:59:04 -0400 Subject: [PATCH] bug #3998 Non-permanent SQL history not working --- ChangeLog | 1 + libraries/relation.lib.php | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 43accd64e0..70fcd6c948 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ phpMyAdmin - ChangeLog interface to enable generating CREATE DATABASE and USE (false by default) - bug #4012 Crash on CSV file import - bug #4009 Statistic Monitor shows only last 3 digits in graph +- bug #3998 Non-permanent SQL history not working 4.0.4.1 (2013-06-30) - [security] Global variables scope injection vulnerability (see PMASA-2013-7) diff --git a/libraries/relation.lib.php b/libraries/relation.lib.php index efa02110ce..94a7d8116d 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -857,6 +857,14 @@ function PMA_getHistory($username) { $cfgRelation = PMA_getRelationsParam(); + /** + * if db-based history is disabled but there exists a session-based + * history, use it + */ + if (! $GLOBALS['cfg']['QueryHistoryDB'] && isset($_SESSION['sql_history'])) { + return array_reverse($_SESSION['sql_history']); + } + if (! $cfgRelation['historywork']) { return false; }