mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 16:08:55 +02:00
@@ -43,3 +43,5 @@ foreach ($_GET as $name => $value) {
|
||||
foreach ($_POST as $name => $value) {
|
||||
$vars[$name] = $value;
|
||||
}
|
||||
|
||||
array_walk_recursive($vars,'sanitize_array');
|
||||
|
||||
@@ -214,14 +214,6 @@ else {
|
||||
<div class="col-md-12">
|
||||
<?php
|
||||
|
||||
// To help debug the new URLs :)
|
||||
if (isset($devel) || isset($vars['devel'])) {
|
||||
echo("<pre>");
|
||||
print_r($_GET);
|
||||
print_r($vars);
|
||||
echo("</pre>");
|
||||
}
|
||||
|
||||
if ($_SESSION['authenticated']) {
|
||||
// Authenticated. Print a page.
|
||||
if (isset($vars['page']) && !strstr("..", $vars['page']) && is_file("pages/" . $vars['page'] . ".inc.php")) {
|
||||
|
||||
@@ -1255,3 +1255,13 @@ function get_port_id ($ports_mapped, $port, $port_association_mode) {
|
||||
|
||||
return $port_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize
|
||||
* @param mixed $item Reference to Item
|
||||
* @param mixed $key Key
|
||||
* @return void
|
||||
*/
|
||||
function sanitize_array(&$item, $key) {
|
||||
$item = htmlentities($item);
|
||||
}
|
||||
|
||||
@@ -266,6 +266,7 @@ function dbFetchRows($sql, $parameters=array(), $nocache=false) {
|
||||
if ($config['memcached']['enable'] && $nocache === false) {
|
||||
$config['memcached']['resource']->set(hash('sha512',$sql.'|'.serialize($parameters)),$rows,$config['memcached']['ttl']);
|
||||
}
|
||||
array_walk_recursive($rows,'sanitize_array');
|
||||
return $rows;
|
||||
}
|
||||
|
||||
@@ -333,6 +334,7 @@ function dbFetchRow($sql=null, $parameters=array(), $nocache=false) {
|
||||
if ($config['memcached']['enable'] && $nocache === false) {
|
||||
$config['memcached']['resource']->set(hash('sha512',$sql.'|'.serialize($parameters)),$row,$config['memcached']['ttl']);
|
||||
}
|
||||
array_walk_recursive($row,'sanitize_array');
|
||||
return $row;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -267,6 +267,7 @@ function dbFetchRows($sql, $parameters=array(), $nocache=false) {
|
||||
if ($config['memcached']['enable'] && $nocache === false) {
|
||||
$config['memcached']['resource']->set(hash('sha512',$sql.'|'.serialize($parameters)),$rows,$config['memcached']['ttl']);
|
||||
}
|
||||
array_walk_recursive($rows,'sanitize_array');
|
||||
return $rows;
|
||||
}
|
||||
|
||||
@@ -334,6 +335,7 @@ function dbFetchRow($sql=null, $parameters=array(), $nocache=false) {
|
||||
if ($config['memcached']['enable'] && $nocache === false) {
|
||||
$config['memcached']['resource']->set(hash('sha512',$sql.'|'.serialize($parameters)),$row,$config['memcached']['ttl']);
|
||||
}
|
||||
array_walk_recursive($row,'sanitize_array');
|
||||
return $row;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user