404
This commit is contained in:
parent
d9415c7fa6
commit
341b017c01
9
show.php
9
show.php
@ -3,12 +3,17 @@
|
|||||||
$path = realpath($basedir . DIRECTORY_SEPARATOR . ltrim(urldecode($_SERVER["QUERY_STRING"]), '/'));
|
$path = realpath($basedir . DIRECTORY_SEPARATOR . ltrim(urldecode($_SERVER["QUERY_STRING"]), '/'));
|
||||||
|
|
||||||
if (strpos($path, $basedir) !== 0 || substr($path, -4) != ".cfg") {
|
if (strpos($path, $basedir) !== 0 || substr($path, -4) != ".cfg") {
|
||||||
http_response_code(403);
|
http_response_code(404);
|
||||||
die();
|
die("Fichier non trouvé");
|
||||||
}
|
}
|
||||||
|
|
||||||
$conf = file_get_contents($path);
|
$conf = file_get_contents($path);
|
||||||
|
|
||||||
|
if ($conf === false) {
|
||||||
|
http_error_code(404);
|
||||||
|
die("Fichier non trouvé");
|
||||||
|
}
|
||||||
|
|
||||||
preg_match("/ sysname ([\w-]+)/", $conf, $sysname);
|
preg_match("/ sysname ([\w-]+)/", $conf, $sysname);
|
||||||
preg_match("/ip address ([\d.]+)/", $conf, $address);
|
preg_match("/ip address ([\d.]+)/", $conf, $address);
|
||||||
$startPattern = "(?<=\n)";
|
$startPattern = "(?<=\n)";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user