-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
There is a code fragment in /okapi/services/caches/map/TileTree.php:
okapi/okapi/services/caches/map/TileTree.php
Lines 279 to 284 in 3aab571
| try { | |
| list($z21x, $z21y) = self::latlon_to_z21xy($lat, $lon); | |
| } catch (Exception $e) { | |
| /* E.g. division by zero, if the cache is placed at the north pole. */ | |
| return false; | |
| } |
When the "division by zero" problem occurs:
- in PHP 5.6 only a warning is generated, no exception is thrown, evaluation of the code continues as in any non-exceptionable case (probably with
$z21yvalue set to INF) - in PHP 7+ a
DivisionByZeroErroris generated, but it is not caught by abovetry...catchblock, because this error extendsErrornotException. In result a service call throws genericError and does not end correctly
The easiest solution should be to use Throwable instead of Exception but Throwable was added in PHP 7.0 which does not comply with okapi requirement of PHP >= 5.6.
However, is there any okapi server still running on PHP 5.6? Shouldn't the required version be changed to f.ex. 7.0+ ?
Metadata
Metadata
Assignees
Labels
No labels