diff options
| author | eltrac <hi@eltr.ac> | 2026-11-09 11:43:29 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-11-09 11:43:29 +0800 |
| commit | 38c6ed15c58ee0c490ec363fdd6c8e7e8d12b2ec (patch) | |
| tree | bb994055fb35b871e04ccc94988eb240fece34da | |
| parent | 93fef9c8a168cda7cc643c5b60b758e53afc0395 (diff) | |
includes/header: 使用 _SESSION 之前先判断是否已经启动 session #81
判断页面是不是 archive 这种需求放在 SESSION
里面不太合理,我已经忘了几年前的我是怎么想的了,之后再调整吧
| -rw-r--r-- | includes/header.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/header.php b/includes/header.php index 599c6ea..9ddcc36 100644 --- a/includes/header.php +++ b/includes/header.php @@ -159,7 +159,8 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; <h1><?php $this->title(); ?></h1> <div class="header-meta"> <?php if($this->fields->meta==''): - if(!isset($_SESSION["isPageArchive"]) || !$_SESSION["isPageArchive"]){ ?> + if(isset($_SESSION) && + (!isset($_SESSION["isPageArchive"]) || !$_SESSION["isPageArchive"])){ ?> <div class="header-meta-line-one"> <?php if($this->is('post')): ?><span class="hint--bottom" data-tooltip="<?php gtaecho('postTexts','sort_title',$this->category) ?>"><i class="iconfont"></i> <?php $this->category(','); ?></span> <?php endif; ?> <?php if($this->fields->commentShow=='0'):?><span class="hint--bottom" data-tooltip="<?php if($this->commentsNum=='0'): gtecho('commentListTexts', 'commentNumNone'); else:gtaecho('commentListTexts', 'commentNum', $this->commentsNum);endif; ?>"><i class="iconfont"></i> <?php $this->commentsNum('0', '1', '%d'); ?></span> <?php endif;?> |
