织梦DEDECMS首页报错:Warning: Illegal string offset ‘url’ in

今天在访问网站首页时,发现顶部有错误代码显示 :

Warning: Illegal string offset 'url' in /www/include/taglib/flink.lib.php on line 139
Warning: Illegal string offset 'webname' in /www/include/include\taglib\flink.lib.php on line 140
Warning: Illegal string offset 'logo' in /www/include/include\taglib\flink.lib.php on line 141

解决方法:打开“\include\taglib\flink.lib.php”文件把里面的“$row[‘url’]”、“$row[‘webname’]”、“$row[‘logo’]”按下面代码进行替换即可。

原代码:

$rbtext = preg_replace("/\[field:url([\/\s]{0,})\]/isU", $row['url'], $innertext);
$rbtext = preg_replace("/\[field:webname([\/\s]{0,})\]/isU", $row['webname'], $rbtext);
$rbtext = preg_replace("/\[field:logo([\/\s]{0,})\]/isU", $row['logo'], $rbtext);
$rbtext = preg_replace("/\[field:link([\/\s]{0,})\]/isU", $link, $rbtext);
$revalue .= $rbtext;

修改后的代码:

$rbtext = preg_replace("/\[field:url([\/\s]{0,})\]/isU", $dbrow->url, $innertext);
$rbtext = preg_replace("/\[field:webname([\/\s]{0,})\]/isU", $dbrow->webname, $rbtext);
$rbtext = preg_replace("/\[field:logo([\/\s]{0,})\]/isU", $dbrow->logo, $rbtext);
$rbtext = preg_replace("/\[field:link([\/\s]{0,})\]/isU", $link, $rbtext);
$revalue .= $rbtext;

替换后,问题解决。

红色部分即修改后的代码:

THE END