From 4e3c6a2b469977c965fda5ed1af45add6d8089d5 Mon Sep 17 00:00:00 2001 From: Patrick Hayes Date: Tue, 12 Apr 2011 18:54:31 -0700 Subject: [PATCH] Casting to floatval so that we can process string represenations of lat/lon --- lib/geometry/Point.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/geometry/Point.class.php b/lib/geometry/Point.class.php index 8a1cb4e3..3e80adb6 100644 --- a/lib/geometry/Point.class.php +++ b/lib/geometry/Point.class.php @@ -34,6 +34,11 @@ public function __construct($x, $y) { throw new Exception("Bad coordinates: x and y should be numeric"); } + + // Convert to floatval in case they are passed in as a string or integer etc. + $x = floatval($x); + $y = floatval($y); + $this->position = array($x, $y); }