无意中发现一个问题,因为将一个留言改为未审核状态,这个留言是我回复过的,更改父留言后,出现以下错误代码 Warning: Trying to access array offset on value of type null in /www/wwwroot/blog.ziyege.com/usr/themes/HarmonyHues/core/function.php on line 420
Warning: Trying to access array offset on value of type null in /www/wwwroot/blog.ziyege.com/usr/themes/HarmonyHues/core/function.php on line 420
Warning: Trying to access array offset on value of type null in /www/wwwroot/blog.ziyege.com/usr/themes/HarmonyHues/core/function.php on line 420
后经询问Ai,暂时解决了问题
在 getCommentAt() 函数中,$arow 可能为 null 或 false(例如父评论不存在、未审核或数据库查询失败),但代码直接访问了 $arow['url'] 和 $arow['author'],导致 PHP 7.4+ 触发 “Trying to access array offset on value of type null” 警告。
无意中发现一个问题,因为将一个留言改为未审核状态,这个留言是我回复过的,更改父留言后,出现以下错误代码
Warning: Trying to access array offset on value of type null in /www/wwwroot/blog.ziyege.com/usr/themes/HarmonyHues/core/function.php on line 420
Warning: Trying to access array offset on value of type null in /www/wwwroot/blog.ziyege.com/usr/themes/HarmonyHues/core/function.php on line 420
Warning: Trying to access array offset on value of type null in /www/wwwroot/blog.ziyege.com/usr/themes/HarmonyHues/core/function.php on line 420
后经询问Ai,暂时解决了问题
在 getCommentAt() 函数中,$arow 可能为 null 或 false(例如父评论不存在、未审核或数据库查询失败),但代码直接访问了 $arow['url'] 和 $arow['author'],导致 PHP 7.4+ 触发 “Trying to access array offset on value of type null” 警告。
该错误仅在评论带有 @回复 且父评论数据异常时触发,不影响正常浏览。
修复后,若父评论缺失或未审核,将不再输出 @作者 部分,避免页面报错。
建议同时更新主题其他潜在未判空的位置(如 $socialArray 遍历、$cnavbarArray 遍历等),但当前错误仅由 getCommentAt 引起。
好,感谢反馈,后面优化一下
1.缺少类重复定义判断
修改路径core→theme-email.php
if (!class_exists('PHPMailer\PHPMailer\PHPMailer')) {
require 'PHPMailer/PHPMailer.php'; require 'PHPMailer/SMTP.php'; require 'PHPMailer/Exception.php';}
2.没有调用钩子
修改路径components→footer.php
<?php $this->footer(); ?>
👍
这个不修复,只要插件带邮件功能主题主就是500没有防止类重复加载
什么时候出个朋友圈模块和相册模块就完美了
看看我魔改的相册,完美匹配本主题
相册模块可能不开发,可使用编辑页面的文章图片格式+宫格
什么时候出朋友圈我再更新几个版本就不更了,每次更新版本改一大堆
工作暂时没时间,还没计划
今天SSL 到期后,更新,,出现以下错误 提示,,,Warning
: file(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in
/www/wwwroot/blog.ziyege.com/usr/themes/HarmonyHues/components/widgets/widget-yiyan.php
on line
21
Warning
: file(): Failed to enable crypto in
/www/wwwroot/blog.ziyege.com/usr/themes/HarmonyHues/components/widgets/widget-yiyan.php
on line
21
Warning
: file(https://blog.ziyege.com/usr/themes/HarmonyHues/assets/yiyan/yiyan.txt): Failed to open stream: operation failed in
/www/wwwroot/blog.ziyege.com/usr/themes/HarmonyHues/components/widgets/widget-yiyan.php
on line
21
后面优化一下
有个小小的建议,文章中图片默认是100%,有时候不想要那么大的图片,用html时候,发现不生效,可能是CSS覆盖了,,通过自定义CSS解决了,,,,,
max-width: none; width: auto;/ 让带有 width 属性的图片优先使用 HTML 宽度,覆盖原有 max-width:100% /
.markdown-body img[width] {
}
感谢反馈,后期优化文章图片宽度为auto
宫格图片,如果图片尺寸大小不同,会有留白,,询问Ai后,回答:这是CSS Grid布局的常见问题。当图片尺寸不同时,网格会自动拉伸图片填满单元格,导致图片变形或留白。 希望能改进一下,
开启CDN请更新主题,请把所有css/js静态文件清一次缓存,看看再反馈