From 9ba4b464eae5de54213a50833a6974d970ae908b Mon Sep 17 00:00:00 2001 From: laf Date: Tue, 30 Sep 2014 21:30:22 +0100 Subject: [PATCH] Added urldecode/encode support --- 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 c728a6dd5..ada409a05 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 96888b1ce..a5ff9bab3 100644 --- a/html/pages/api-docs.inc.php +++ b/html/pages/api-docs.inc.php @@ -72,7 +72,7 @@ if ($_SESSION['userlevel'] == '10')