mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
strip (#) comments out of files
This commit is contained in:
parent
98b779400b
commit
0dd62c8813
@ -74,16 +74,17 @@ function enable_hardware_offloading($interface) {
|
||||
*/
|
||||
function return_filename_as_array($filename) {
|
||||
$file = array();
|
||||
if(!file_exists($filename)) return $file;
|
||||
$text = return_filename_as_string($filename);
|
||||
$text_split = split("\n", $text);
|
||||
$counter = 0;
|
||||
foreach($text_split as $line) {
|
||||
if(strpos($line, "#") == 0)
|
||||
unset($text_split($counter));
|
||||
$counter++;
|
||||
if(file_exists($filename)) {
|
||||
$text = return_filename_as_string($filename);
|
||||
$text_split = split("\n", $text);
|
||||
|
||||
/* Strip out comments */
|
||||
while (($line = array_shift($text_split)) != NULL) {
|
||||
if(strpos($line, "#") !== 0)
|
||||
array_push($file, $line);
|
||||
}
|
||||
}
|
||||
return $text_split;
|
||||
return $file;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -492,4 +493,4 @@ function update_progress_bar($percent) {
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user