fix: 修复AI查询页面时间显示的类型错误
- 为 generated_time 和 detection_time 添加空值检查 - 避免将空字符串传递给 date() 函数导致 TypeError - 空值时显示'未知'而不是报错
This commit is contained in:
@@ -494,7 +494,7 @@ html.darkmode .ai-verify-subtitle { color: #aaa; }
|
||||
</div>
|
||||
<div class="ai-info-item">
|
||||
<span class="ai-info-label"><?php _e('生成时间', 'argon'); ?></span>
|
||||
<span class="ai-info-value"><?php echo esc_html(date('Y-m-d H:i:s', intval($result['generated_time']))); ?></span>
|
||||
<span class="ai-info-value"><?php echo $result['generated_time'] ? esc_html(date('Y-m-d H:i:s', intval($result['generated_time']))) : __('未知', 'argon'); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -628,7 +628,7 @@ html.darkmode .ai-verify-subtitle { color: #aaa; }
|
||||
</div>
|
||||
<div class="ai-info-item">
|
||||
<span class="ai-info-label"><?php _e('检测时间', 'argon'); ?></span>
|
||||
<span class="ai-info-value"><?php echo esc_html(date('Y-m-d H:i:s', intval($result['detection_time']))); ?></span>
|
||||
<span class="ai-info-value"><?php echo $result['detection_time'] ? esc_html(date('Y-m-d H:i:s', intval($result['detection_time']))) : __('未知', 'argon'); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user