Skip to content

Commit

Permalink
Casting to floatval so that we can process string represenations of l…
Browse files Browse the repository at this point in the history
…at/lon
  • Loading branch information
phayes committed Apr 13, 2011
1 parent c732ad6 commit 4e3c6a2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/geometry/Point.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 4e3c6a2

Please sign in to comment.