Skip to content

Commit

Permalink
PHP 8.1 Deprecated: strtr(): Passing null to parameter #1 ($string) o…
Browse files Browse the repository at this point in the history
…f type string is deprecated on line 147
  • Loading branch information
Christian Ebert committed May 4, 2022
1 parent 0528fa8 commit 88408ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/Zend/View/Helper/FormElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
['[' => '-', ']' => '']), '-');
}
Expand Down

0 comments on commit 88408ec

Please sign in to comment.