Здравствуйте, после обновления на php 8 вылезла такая ошибка:
<div class="phone<pre>[TypeError]
Cannot access offset of type string on string (0)
/home/u455502/regit.ru/www/bitrix/php_interface/init.php:16
#0: ShowMyHeaderPhones()
/home/u455502/regit.ru/www/bitrix/templates/regit/page_blocks/header_8.php:86
#1: include_once(string)
/home/u455502/regit.ru/www/bitrix/modules/aspro.digital/classes/general/CDigital.php:197
#2: CDigital::ShowPageType(string)
/home/u455502/regit.ru/www/bitrix/templates/regit/header.php:85
#3: include_once(string)
/home/u455502/regit.ru/www/bitrix/modules/main/include/prolog_after.php:110
#4: require(string)
/home/u455502/regit.ru/www/bitrix/modules/main/include/prolog.php:11
#5: require_once(string)
/home/u455502/regit.ru/www/bitrix/header.php:1
#6: require(string)
/home/u455502/regit.ru/www/index.php:2
<div class="phone<pre>[TypeError]
Cannot access offset of type string on string (0)
/home/u455502/regit.ru/www/bitrix/php_interface/init.php:16
#0: ShowMyHeaderPhones()
/home/u455502/regit.ru/www/bitrix/templates/regit/page_blocks/header_8.php:86
#1: include_once(string)
/home/u455502/regit.ru/www/bitrix/modules/aspro.digital/classes/general/CDigital.php:197
#2: CDigital::ShowPageType(string)
/home/u455502/regit.ru/www/bitrix/templates/regit/header.php:85
#3: include_once(string)
/home/u455502/regit.ru/www/bitrix/modules/main/include/prolog_after.php:110
#4: require(string)
/home/u455502/regit.ru/www/bitrix/modules/main/include/prolog.php:11
#5: require_once(string)
/home/u455502/regit.ru/www/bitrix/header.php:1
#6: require(string)
/home/u455502/regit.ru/www/index.php:2
| Код |
|---|
<?function ShowMyHeaderPhones($class = '')
{
$arBackParametrs = CDigital::GetBackParametrsValues(SITE_ID);
?>
<?if($arBackParametrs['HEADER_PHONES']): // count of phones?>
<?
$phone = $arBackParametrs['HEADER_PHONES_array_PHONE_VALUE_0'];
if(stristr($phone, "#") !== false)
{
$array = explode("#", $phone);
$phone = trim($array[1]);
$otdel = trim($array[0]);
}
$href = 'tel:'.str_replace(array(' ', '-', '(', ')'), '', $phone);
?>
<div class="phone<?=(intval($arBackParametrs['HEADER_PHONES']['VALUE']) > 1 ? ' with_dropdown' : '')?><?=($class ? ' '.$class : '')?>">
<i class="svg svg-phone"></i>
<a href="<?=$href?>"><!--<span class="otdel"><?=$otdel?></span> --><?=$phone?></a>
<?if($arBackParametrs['HEADER_PHONES'] > 1): // if more than one?>
<div class="dropdown">
<div class="wrap">
<?for($i = 1; $i < $arBackParametrs['HEADER_PHONES']; ++$i):?>
<?
$phone = $arBackParametrs['HEADER_PHONES_array_PHONE_VALUE_'.$i];
if(stristr($phone, "#") !== false)
{
$array = explode("#", $phone);
$phone = trim($array[1]);
$otdel = trim($array[0]);
}
|