Skip to content

Commit

Permalink
Prevent PHP error when checking type in the map (merges PR phayes#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
itamair committed Feb 4, 2023
1 parent 6a7eaa9 commit 84803f6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions geoPHP.inc
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ class geoPHP
$args = $format;
}

$processor_type = $type_map[$type];

if (!$processor_type) {
if (array_key_exists($type, $type_map)) {
$processor_type = $type_map[$type];
}
else {
throw new exception('geoPHP could not find an adapter of type '.htmlentities($type));
}

Expand Down

0 comments on commit 84803f6

Please sign in to comment.