Added urldecode/encode support

This commit is contained in:
laf
2014-09-30 21:30:22 +01:00
parent 10e24653be
commit 9ba4b464ea
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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');