From 201d1f9972d0426b37c07708a9543986ce8f4b2d Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 4 Nov 2021 17:23:45 +0100 Subject: [PATCH] Fix PHP8.0 error (TypeError): strlen(): Argument #1 ($string) must be of type string, array given --- api/src/Storage/Base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/Storage/Base.php b/api/src/Storage/Base.php index 655d7dd965..3fa3d70d27 100644 --- a/api/src/Storage/Base.php +++ b/api/src/Storage/Base.php @@ -632,7 +632,7 @@ class Base { continue; // no need to write that (unset) column } - if ($this->table_def['fd'][$db_col]['type'] == 'varchar' && + if ($this->table_def['fd'][$db_col]['type'] == 'varchar' && is_string($this->data[$col]) && strlen($this->data[$col]) > $this->table_def['fd'][$db_col]['precision']) { // truncate the field to mamimum length, if upper layers didn't care