xss hardening

This commit is contained in:
Tom Mortensen
2025-01-22 21:22:32 -08:00
parent f8e1d85681
commit b3e355b29b
33 changed files with 190 additions and 124 deletions

View File

@@ -288,13 +288,6 @@ function transpose_user_path($path) {
}
return $path;
}
// custom parse_ini_file/string functions to deal with '#' comment lines
function my_parse_ini_string($text, $sections=false, $scanner=INI_SCANNER_NORMAL) {
return parse_ini_string(preg_replace('/^#/m',';',$text),$sections,$scanner);
}
function my_parse_ini_file($file, $sections=false, $scanner=INI_SCANNER_NORMAL) {
return my_parse_ini_string(file_get_contents($file),$sections,$scanner);
}
function cpu_list() {
exec('cat /sys/devices/system/cpu/*/topology/thread_siblings_list|sort -nu', $cpus);
return $cpus;
@@ -395,4 +388,9 @@ function get_realvolume($path) {
}
return $reallocation;
}
function device_exists($name)
{
global $disks,$devs;
return (array_key_exists($name, $disks) && !str_contains(_var($disks[$name],'status'),'_NP')) || (array_key_exists($name, $devs));
}
?>