Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated
- meu3
- Сообщения: 462
- Зарегистрирован: 28 сен 2018, 13:21
- Имя: Юрий Трифонов
- Откуда: Россия Севастополь
- Организация: IDEA
Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated
Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/uxxxx/data/www/xxxxx.ru/includes/classes/fieldstypes/fieldtype_text_pattern.php on line 142
- meu3
- Сообщения: 462
- Зарегистрирован: 28 сен 2018, 13:21
- Имя: Юрий Трифонов
- Откуда: Россия Севастополь
- Организация: IDEA
Re: Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated
Migration to PHP 8.1 - how to fix Deprecated Passing null to parameter error - rename build in functions
PHP 8.1 has deprecated passing null as parameters to a lot of core functions.
Depending how many cases you have, you may be able to just fix them manually a few at a time, either adding ?? '' or fixing a logic bug where you weren't expecting a null anyway.
Нужно в 142 строке добавить->
должно получится так:
PHP 8.1 has deprecated passing null as parameters to a lot of core functions.
Depending how many cases you have, you may be able to just fix them manually a few at a time, either adding ?? '' or fixing a logic bug where you weren't expecting a null anyway.
Нужно в 142 строке добавить
Код: Выделить всё
?? ''
должно получится так:
Код: Выделить всё
if(strlen($item['field_' . $field['id']] ?? '') == 0)
- support
- Техническая поддержка
- Сообщения: 9181
- Зарегистрирован: 19 окт 2014, 18:22
- Имя: Харчишин Сергей
- Откуда: Крым, Евпатория
Re: Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated
Поправил для версии 3.4.3