126 Star 895 Fork 322

若水印象 / tp6

 / 详情

php8.2中出现的错误

待办的
缺陷
创建于  
2024-04-30 16:47

最新的版本的php,对参数的类型更加严格,如把null输入到string函数会出错,希望能完善一下兼容。
因为default_filter默认使用htmlentities,好多模板直接出错,如下所示

htmlentities(): Passing null to parameter #1 ($string) of type string is deprecated

<body class="hold-transition sidebar-mini layout-fixed layout-navbar-fixed pace-primary text-sm <?php if($layer == true): ?>layer-body<?php endif; ?>" data-display_mode="<?php echo htmlentities($system['display_mode']); ?>">

评论 (2)

木子三有 创建了缺陷

这应该是think-template的问题了,而且你为什么会出现null的情况?

think-template3.0版本修复了问题,此cms用的是think-template2.0.9,因为"topthink/think-view": "^1.0",其中用的template,topthink/think-view 2.0版本以后就引用think-template3.0了,
你可以composer.json中修改

"php": ">=8.0.0",
"topthink/think-view": "^2.0",

删除两个

"lcobucci/jwt": "^3.3.3",
"zzstudio/think-addons": "^2.0",

执行更新一下试试,如果你还需要用插件和jwt可以自己重新添加下,如果那俩还有新版本的话,好像不更新了

composer update

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
755127 cy23 1685086711 102146 ffcz 1656252671
PHP
1
https://gitee.com/ruoshuiyx/tp6.git
git@gitee.com:ruoshuiyx/tp6.git
ruoshuiyx
tp6
tp6

搜索帮助

344bd9b3 5694891 D2dac590 5694891