diff --git a/Projects/TDoR/src/models/reports.php b/Projects/TDoR/src/models/reports.php index a5f2165..a3464f6 100644 --- a/Projects/TDoR/src/models/reports.php +++ b/Projects/TDoR/src/models/reports.php @@ -1406,8 +1406,8 @@ function set_from_row($row) if (isset($row['latitude']) ) { - $this->latitude = $row['latitude']; - $this->longitude = $row['longitude']; + $this->latitude = (double)$row['latitude']; + $this->longitude = (double)$row['longitude']; } $this->cause = stripslashes($row['cause']); diff --git a/Projects/TDoR/src/views/pages/admin/admin_utils.php b/Projects/TDoR/src/views/pages/admin/admin_utils.php index 85d74e2..bd0bd49 100644 --- a/Projects/TDoR/src/views/pages/admin/admin_utils.php +++ b/Projects/TDoR/src/views/pages/admin/admin_utils.php @@ -238,6 +238,8 @@ public static function add_csv_items($csv_items, $reports_table, $temp_reports_t */ private static function report_contents_match($report1, $report2) { + $delta = 1E-8; + if ( ($report1->name == $report2->name) && ($report1->age == $report2->age) && ($report1->photo_filename == $report2->photo_filename) && @@ -247,8 +249,8 @@ private static function report_contents_match($report1, $report2) ($report1->tdor_list_ref == $report2->tdor_list_ref) && ($report1->location == $report2->location) && ($report1->country == $report2->country) && - ($report1->latitude == $report2->latitude) && - ($report1->longitude == $report2->longitude) && + (abs($report1->latitude - $report2->latitude) < $delta) && + (abs($report1->longitude - $report2->longitude) < $delta) && ($report1->cause == $report2->cause) && ($report1->description == $report2->description) && ($report1->tweet == $report2->tweet) &&