From dbab1c12ca8bac06c662ac1e4ddaa4dd2ebb4511 Mon Sep 17 00:00:00 2001 From: laf Date: Tue, 30 Sep 2014 01:26:37 +0100 Subject: [PATCH] Added urldecode/urlencode to ifname variables --- html/includes/api_functions.inc.php | 4 ++-- html/pages/api-docs.inc.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/html/includes/api_functions.inc.php b/html/includes/api_functions.inc.php index c728a6dd51..ada409a053 100644 --- a/html/includes/api_functions.inc.php +++ b/html/includes/api_functions.inc.php @@ -191,7 +191,7 @@ function get_graph_by_port_hostname() $router = $app->router()->getCurrentRoute()->getParams(); $hostname = $router['hostname']; $vars = array(); - $vars['port'] = $router['ifname']; + $vars['port'] = urldecode($router['ifname']); $vars['type'] = $router['type'] ?: 'port_bits'; if(!empty($_GET['from'])) { @@ -215,7 +215,7 @@ function get_port_stats_by_port_hostname() global $config; $app = \Slim\Slim::getInstance(); $router = $app->router()->getCurrentRoute()->getParams(); - $ifName = $router['ifname']; + $ifName = urldecode($router['ifname']); $stats = dbFetchRow("SELECT * FROM `ports` WHERE `ifName`=?", array($ifName)); $output = array("status" => "ok", "port" => $stats); $app->response->headers->set('Content-Type', 'application/json'); diff --git a/html/pages/api-docs.inc.php b/html/pages/api-docs.inc.php index 96888b1ce8..a5ff9bab38 100644 --- a/html/pages/api-docs.inc.php +++ b/html/pages/api-docs.inc.php @@ -72,7 +72,7 @@ if ($_SESSION['userlevel'] == '10')