From b7df4fd9cb46b69387eaadb88cfb2a56189e6dcf Mon Sep 17 00:00:00 2001 From: peterliu <2202055828@qq.com> Date: Tue, 24 Sep 2024 09:00:39 +0800 Subject: [PATCH] Fix for PHP8.3 Fix ErrorException: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in .../vendor/getuilaboratory/getui-pushapi-php-client/protobuf/type/pb_string.php:38 --- protobuf/type/pb_string.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protobuf/type/pb_string.php b/protobuf/type/pb_string.php index de49ed9..04ec21b 100644 --- a/protobuf/type/pb_string.php +++ b/protobuf/type/pb_string.php @@ -35,7 +35,7 @@ public function SerializeToString($rec = -1) $string .= $this->base128->set_value($rec << 3 | $this->wired_type); } - $string .= $this->base128->set_value(strlen($this->value)); + $string .= $this->base128->set_value(strlen($this->value ? $this->value : '')); $string .= $this->value; return $string;