From 216e27a688b0e2a76f2eac6407b631d84db1496d Mon Sep 17 00:00:00 2001 From: "Jehan-Guillaume (ioguix) de Rorthais" Date: Tue, 21 Feb 2012 23:18:13 +0100 Subject: [PATCH] Fix a bug when executing a query from the history sql.php is not looking for queries from _GET anymore and history was passing its query through it. --- history.php | 4 ++-- sql.php | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/history.php b/history.php index 0c837459..83b2dff4 100644 --- a/history.php +++ b/history.php @@ -53,8 +53,8 @@ $actions = array( 'run' => array( 'title' => $lang['strexecute'], - 'url' => "sql.php?{$misc->href}&nohistory=t&", - 'vars' => array('query' => 'query', 'paginate' => 'paginate'), + 'url' => "sql.php?{$misc->href}&nohistory=t&subject=history&", + 'vars' => array('queryid' => 'queryid', 'paginate' => 'paginate'), 'target' => 'detail', ), 'remove' => array( diff --git a/sql.php b/sql.php index 9ab6fc59..66ad3903 100644 --- a/sql.php +++ b/sql.php @@ -80,10 +80,15 @@ $report = $reportsdb->getReport($_REQUEST['reportid']); $_SESSION['sqlquery'] = $report->fields['report_sql']; } + elseif (isset($_REQUEST['subject']) && $_REQUEST['subject'] == 'history') { + // Or maybe we came from the history popup + $_SESSION['sqlquery'] = $_SESSION['history'][$_REQUEST['server']][$_REQUEST['database']][$_GET['queryid']]['query']; + } elseif (isset($_POST['query'])) { // Or maybe we came from an sql form $_SESSION['sqlquery'] = $_POST['query']; - } else { + } + else { echo "could not find the query!!"; } -- 2.39.5