zoukankan      html  css  js  c++  java
  • phpcms切换到php7.2后无法修改文章提示Uncaught Error: [] operator not supported for strings

      前段时间将客户的phpcms站点升级到php7.2,相对比较顺利,但是今天他反应文章无法修改了,提示Uncaught Error: [] operator not supported for strings 错误,这就有点尴尬了,可能是PHP7以上对语法要求比较严谨,那我们就照着错误提示来寻找解决方案

    Fatal error: Uncaught Error: [] operator not supported for strings in 
    *****phpcmsmodulesadminclassespush_api.class.php:145 Stack trace: #0 
    *****phpcmsmodulesadminclassespush_api.class.php(50): push_api->position_list(Array, Array, 0, 'content_model') #1 
    *****cachescaches_modelcaches_datacontent_update.class.php(62): push_api->position_update(4, 1, 14, Array, Array, 0) #2 
    *****cachescaches_modelcaches_datacontent_update.class.php(18): content_update->posid('posids', Array) #3 
    *****phpcmsmodelcontent_model.class.php(303): content_update->update(Array) #4 
    *****phpcmsmodulescontentcontent.php(221): content_model->edit_content(Array, 4) #5 
    *****phpcmslibsclassesapplication.class.php(31): content->edit() #6 
    *****phpcmslibs in 
    *****phpcmsmodulesadminclassespush_api.class.php on line 145
    

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

    $fields_arr = $fields_value = '';
    

      将它改为

    $fields_arr = $fields_value = [];
    

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

  • 相关阅读:
    【FastJSON序列化】FastJSON序列化
    【EsayExcel】EsayExcel生成自定义表头
    时间序列的基础频率
    问题记录 --> 未定义的引用 ||| not found
    linux shell find 用法大全
    pgrep -f abc匹配出含abc的进程 ||||||| pid pkill -f abc
    >/dev/null 2>&1
    编译,发版,链接库问题
    shell 问题 source project_env.sh
    linux/ubuntu 压缩与解压
  • 原文地址:https://www.cnblogs.com/ytkah/p/10980766.html
Copyright © 2011-2022 走看看