From 88408ec83f1ab3a6a8660c7a3b2543e7c806df06 Mon Sep 17 00:00:00 2001 From: Christian Ebert Date: Wed, 4 May 2022 09:09:56 +0200 Subject: [PATCH] PHP 8.1 Deprecated: strtr(): Passing null to parameter #1 ($string) of type string is deprecated on line 147 --- library/Zend/View/Helper/FormElement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Zend/View/Helper/FormElement.php b/library/Zend/View/Helper/FormElement.php index 90fa340b45..fa43ae2e42 100644 --- a/library/Zend/View/Helper/FormElement.php +++ b/library/Zend/View/Helper/FormElement.php @@ -142,7 +142,7 @@ protected function _getInfo($name, $value = null, $attribs = null, // Set ID for element if (array_key_exists('id', $attribs)) { $info['id'] = (string)$attribs['id']; - } else if ('' !== $info['name']) { + } else if (is_string($info['name']) && '' !== $info['name']) { $info['id'] = trim(strtr($info['name'], ['[' => '-', ']' => '']), '-'); }