From 33e6fffd5dcb76e4d75b3acd1cbf3da296e7a7a3 Mon Sep 17 00:00:00 2001 From: Carlos V <76731844+cvc90@users.noreply.github.com> Date: Sat, 19 Aug 2023 15:40:11 +0200 Subject: [PATCH] Update internetinfo.php Added new function to check if there is an error --- front/php/server/internetinfo.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/front/php/server/internetinfo.php b/front/php/server/internetinfo.php index 0f1fd1f7..a9864bed 100644 --- a/front/php/server/internetinfo.php +++ b/front/php/server/internetinfo.php @@ -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 "
"; + echo $output; + echo ""; + exit; +} + // Replace "{" with "" $output = str_replace("{", "", $output);