From 84803f6d28787fc4b84242d4d1b4d10c094a7a37 Mon Sep 17 00:00:00 2001 From: itamair Date: Sat, 4 Feb 2023 19:57:48 +0100 Subject: [PATCH] Prevent PHP error when checking type in the map (merges PR https://github.com/phayes/geoPHP/pull/154) --- geoPHP.inc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/geoPHP.inc b/geoPHP.inc index c327cb73..81328b14 100644 --- a/geoPHP.inc +++ b/geoPHP.inc @@ -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)); }