From 9fb1e879f30b80f1599c009b70d75dad2ae3f43e Mon Sep 17 00:00:00 2001 From: Sancho Lerena Date: Thu, 8 Jan 2015 19:05:43 +0100 Subject: [PATCH] Solved a problem with autorefresh URL. This fixes problem on refreshing the same URL for a long time (p.e: 4 hours). Problem was the filename was not passed, and this, in someway, makes the whole system to add parameters to the right until it too long and breaks it. To avoid other problems, I've added a safe check to see if coming URL contains "index.php" before adding it. Tested on several subcomponents and works. --- pandora_console/include/functions_ui.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index d710f6ba39..6dffc006ad 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -1216,7 +1216,7 @@ function ui_process_page_head ($string, $bitfield) { $_GET['sec2'] == 'operation/snmpconsole/snmp_view' || $_GET['sec2'] == 'enterprise/dashboard/main_dashboard') { - $query = ui_get_url_refresh (false); + $query = ui_get_url_refresh (false, false); $output .= ''; @@ -1229,8 +1229,8 @@ function ui_process_page_head ($string, $bitfield) { - - + + @@ -2038,8 +2038,13 @@ function ui_toggle($code, $name, $title = '', $hidden_default = true, $return = function ui_get_url_refresh ($params = false, $relative = true, $add_post = true) { // Agent selection filters and refresh global $config; - $url = ''; - + + // slerena, 8/Ene/2015 - Need to put index.php on URL which have it. + if (strpos($_SERVER['REQUEST_URI'], 'index.php') === false) + $url = ''; + else + $url = 'index.php'; + if (sizeof ($_REQUEST)) { //Some (old) browsers don't like the ?&key=var $url .= '?'; @@ -2118,6 +2123,7 @@ function ui_get_url_refresh ($params = false, $relative = true, $add_post = true } $url = htmlspecialchars ($url); + if (! $relative) { return ui_get_full_url ($url); }