diff --git a/ChangeLog b/ChangeLog index abd40c777b..25b3dc323c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -41,6 +41,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 c2ffdff99d..a21db15c6e 100644 --- a/libraries/relation.lib.php +++ b/libraries/relation.lib.php @@ -905,6 +905,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; }