phpcms切换到php7.2后无法修改文章提示Uncaught Error: [] operator not supported for strings

添加时间:2023-07-23 10:29:30


 前段时间将客户的phpcms站点升级到php7.2,相对比较顺利,但是今天他反应文章无法修改了,提示Uncaught Error: [] operator not supported for strings 错误,这就有点尴尬了,可能是PHP7以上对语法要求比较严谨,那我们就照着错误提示来寻找解决方案
1
2
3
4
5
6
7
8
9
10
Fatal error: Uncaught Error: [] operator not supported for strings in
*****\phpcms\modules\admin\classes\push_api.class.php:145 Stack trace: #0
*****\phpcms\modules\admin\classes\push_api.class.php(50): push_api->position_list(Array, Array, 0, 'content_model') #1
*****\caches\caches_model\caches_data\content_update.class.php(62): push_api->position_update(4, 1, 14, Array, Array, 0) #2
*****\caches\caches_model\caches_data\content_update.class.php(18): content_update->posid('posids', Array) #3
*****\phpcms\model\content_model.class.php(303): content_update->update(Array) #4
*****\phpcms\modules\content\content.php(221): content_model->edit_content(Array, 4) #5
*****\phpcms\libs\classes\application.class.php(31): content->edit() #6
*****\phpcms\libs in
*****\phpcms\modules\admin\classes\push_api.class.php on line 145

  打开/phpcms/modules/admin/classes/push_api.class.php,大概在约 141行,

1
$fields_arr $fields_value '';

  将它改为

1
$fields_arr $fields_value = [];

  保存,上传,覆盖文件,重新编辑一下文章看看,这次果然可以了


202303-14

解决lists标签中,加上where后其他条件失效的问题

问题描述:{pc:content action="lists" catid="$catid" where="posids`!=& 39;0& 39;" thumb="1" num="10"}发现不是调用当前栏目而是

201712-29

引导推荐是提升网站建设营销效果的有效方法

我们在一些大的资讯门户类网站上阅读新闻的时候,一篇文章后面一般在结尾的地方会有相关阅读,相关阅读里面的内容与当前内容是相关联的


建站套餐我们专注设计,只做一件事 :持续为客户创造价值

——
设计网站

设计网站

大部分客户都要问:做个网站大概多少钱? 答:主要看需求,常见的大概五六千吧

模板网站

模板网站

上百个网站样式模板,适合中小公司做网站,价格低,网站美,同时满足起步型公司的需求。

维护网站

维护网站

企业事务忙没时间管理网站?请专人管理网站成本太高?一天仅1~10元解决网站所有问题!