mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Update internetinfo.php
Added new function to check if there is an error
This commit is contained in:
@@ -18,6 +18,17 @@ require dirname(__FILE__).'/../server/init.php';
|
|||||||
// Perform a test with the PING command
|
// Perform a test with the PING command
|
||||||
$output = shell_exec("curl ipinfo.io");
|
$output = shell_exec("curl ipinfo.io");
|
||||||
|
|
||||||
|
// Check if there is error
|
||||||
|
if (!isset($output) || empty($output)) {
|
||||||
|
// Error message
|
||||||
|
$output = lang('DevDetail_Internet_Info_Error');
|
||||||
|
// Show the result
|
||||||
|
echo "<pre>";
|
||||||
|
echo $output;
|
||||||
|
echo "</pre>";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
// Replace "{" with ""
|
// Replace "{" with ""
|
||||||
$output = str_replace("{", "", $output);
|
$output = str_replace("{", "", $output);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user