mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Use checkfile on get.php
Move checkfile to funcs.php to be used by more scripts
This commit is contained in:
+13
-1
@@ -7,4 +7,16 @@ function is_valid_domain_name($domain_name)
|
||||
preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $domain_name)); //length of each label
|
||||
}
|
||||
|
||||
?>
|
||||
function checkfile($filename) {
|
||||
if(is_readable($filename))
|
||||
{
|
||||
return $filename;
|
||||
}
|
||||
else
|
||||
{
|
||||
// substitute dummy file
|
||||
return "/dev/null";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user