From ee004fd2d049fa5ad40c9143a2cc733e4ae8443c Mon Sep 17 00:00:00 2001 From: adolfintel Date: Wed, 5 Sep 2018 15:46:50 +0200 Subject: [PATCH 1/3] Updated getIP.php so it will ignore errors --- getIP.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/getIP.php b/getIP.php index e30cde3..718a825 100644 --- a/getIP.php +++ b/getIP.php @@ -4,8 +4,11 @@ Output from this script is a JSON string composed of 2 objects: a string called processedString which contains the combined IP, ISP, Contry and distance as it can be presented to the user; and an object called rawIspInfo which contains the raw data from ipinfo.io (will be empty if isp detection is disabled). Client side, the output of this script can be treated as JSON or as regular text. If the output is regular text, it will be shown to the user as is. */ +error_reporting(0); $ip = ""; header('Content-Type: application/json; charset=utf-8'); +header('Access-Control-Allow-Origin: *'); +header('Access-Control-Allow-Methods: GET, POST'); if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['X-Real-IP'])) { From cb944de1189c57dad229518f47548c8f32853bc7 Mon Sep 17 00:00:00 2001 From: adolfintel Date: Fri, 7 Sep 2018 10:59:31 +0200 Subject: [PATCH 2/3] Removed CORS headers (added by accident in previous commit) --- getIP.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/getIP.php b/getIP.php index 718a825..79f620a 100644 --- a/getIP.php +++ b/getIP.php @@ -7,8 +7,6 @@ error_reporting(0); $ip = ""; header('Content-Type: application/json; charset=utf-8'); -header('Access-Control-Allow-Origin: *'); -header('Access-Control-Allow-Methods: GET, POST'); if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['X-Real-IP'])) { From 52e91f9054b0d897b79a67e697b5e2ae11c1caa3 Mon Sep 17 00:00:00 2001 From: Mark Felder <40271278+feld@users.noreply.github.com> Date: Mon, 17 Sep 2018 14:06:55 -0500 Subject: [PATCH 3/3] Fix results image for jitter (#158) Postgres and SQLite were referencing the wrong variable causing the jitter field to always be empty. --- results/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/results/index.php b/results/index.php index 4ee82e1..d8bc265 100644 --- a/results/index.php +++ b/results/index.php @@ -70,7 +70,7 @@ if($db_type=="mysql"){ $dl=$row["dl"]; $ul=$row["ul"]; $ping=$row["ping"]; - $jitter=$row["jitter"]; + $jit=$row["jitter"]; $conn=null; }else if($db_type=="postgresql"){ $conn_host = "host=$PostgreSql_hostname"; @@ -85,7 +85,7 @@ if($db_type=="mysql"){ $dl=$row["dl"]; $ul=$row["ul"]; $ping=$row["ping"]; - $jitter=$row["jitter"]; + $jit=$row["jitter"]; $conn=null; }else die(); @@ -130,4 +130,4 @@ header('Content-Type: image/png'); imagepng($im); imagedestroy($im); -?> \ No newline at end of file +?>