Added urldecode for ports in API to deal with slashes in port names

This commit is contained in:
laf
2014-08-13 23:20:43 +01:00
parent 754c0b0507
commit b980710a4e
3 changed files with 7 additions and 1 deletions

View File

@@ -90,12 +90,15 @@ Next, add the following to `/etc/apache2/sites-available/librenms.conf`:
ServerName librenms.example.com
CustomLog /opt/librenms/logs/access_log combined
ErrorLog /opt/librenms/logs/error_log
AllowEncodedSlashes On
<Directory "/opt/librenms/html/">
AllowOverride All
Options FollowSymLinks MultiViews
</Directory>
</VirtualHost>
If you are running Apache 2.2.18 or higher then change AllowEncodedSlashes to NoDecode
If you have Apache 2.3 or newer then please add the following line before `AllowOverride All`:
Require all granted

View File

@@ -101,12 +101,15 @@ Next, add the following to `/etc/httpd/conf.d/librenms.conf`
ServerName librenms.example.com
CustomLog /opt/librenms/logs/access_log combined
ErrorLog /opt/librenms/logs/error_log
AllowEncodedSlashes On
<Directory "/opt/librenms/html/">
AllowOverride All
Options FollowSymLinks MultiViews
</Directory>
</VirtualHost>
If you are running Apache 2.2.18 or higher then change AllowEncodedSlashes to NoDecode
Don't forget to restart Apache to make this active:
service httpd restart

View File

@@ -215,7 +215,7 @@ function get_graph_by_port()
$router = $app->router()->getCurrentRoute()->getParams();
$device_id = $router['id'];
$vars = array();
$vars['port'] = $router['port'];
$vars['port'] = urldecode($router['port']);
$vars['type'] = $router['type'] ?: 'port_bits';
if(!empty($router['from']))
{