Update internetinfo.php

Added new function to check if there is an error
This commit is contained in:
Carlos V
2023-08-19 15:40:11 +02:00
committed by GitHub
parent c61caed1af
commit 33e6fffd5d

View File

@@ -18,6 +18,17 @@ require dirname(__FILE__).'/../server/init.php';
// Perform a test with the PING command
$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 ""
$output = str_replace("{", "", $output);