From 8653f596e3c20d5f3a65b4633c21e9a034cd85a0 Mon Sep 17 00:00:00 2001 From: Gert Wijnalda Date: Thu, 6 Jan 2022 12:50:36 +0100 Subject: [PATCH] Assign point size without deprecation notice `strlen` with a `null` argument triggers a deprecation notice from PHP 8.1; this change ensures that doesn't happen anymore. --- lib/CrEOF/Geo/WKB/Parser.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/CrEOF/Geo/WKB/Parser.php b/lib/CrEOF/Geo/WKB/Parser.php index ce30e38..e5a6a2d 100644 --- a/lib/CrEOF/Geo/WKB/Parser.php +++ b/lib/CrEOF/Geo/WKB/Parser.php @@ -154,7 +154,9 @@ private function readGeometry() } $this->dimensions = $this->getDimensions($this->type); - $this->pointSize = 2 + strlen($this->getDimensionType($this->dimensions)); + $dimensionType = this->getDimensionType($this->dimensions); + if($dimensionType === null) $dimensionType = ''; + $this->pointSize = 2 + strlen($dimensionType); $typeName = $this->getTypeName($this->type);