Commit f438872f authored by Adam Wujek's avatar Adam Wujek 💬

[BUG: 1633] fix webinterface to be able to ignore comments at the end of dot-config lines

Comments are simply ignored. There are not written back to the dot-config.
This solution does not support "#" signs in the parameters' values.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 3791bdd4
......@@ -1352,6 +1352,15 @@ function wrs_reboot($timeout=40){
function load_kconfig(){
$_SESSION['LASTIME'] = filectime($GLOBALS['kconfigfile']);
$_SESSION['KCONFIG'] = parse_ini_file($GLOBALS['kconfigfile']);
/* Ignore everything after "#". It is intended to ignore comments at
* the end of a line. However, it will also affect items with "#" in
* the value.
* NOTE: When dot-config is written back all coments will be gone!
*/
foreach ($_SESSION['KCONFIG'] as &$row) {
$no_comments = explode("#",$row);
$row = $no_comments[0];
}
}
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment