Skip to content

Commit bf4b5d7

Browse files
LightLight
authored andcommitted
fix: 优化夜间模式的判定
1 parent 20d042d commit bf4b5d7

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/404.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!DOCTYPE HTML>
44
<html lang="zh">
55
<?php $this->need('header.php'); ?>
6-
<body class="page-body <?php echo $_COOKIE['night'] == '1' ? 'night' : ''; ?>">
6+
<body class="page-body <?php echo isset($_COOKIE['night']) && $_COOKIE['night'] == '1' ? 'night' : ''; ?>">
77
<div class="main-content">
88
<div class="error-page text-center">
99
<h1 class="error-page-title">404 - <?php _e('您要找的页面未找到。'); ?></h1>

src/page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<!DOCTYPE html>
1212
<?php $this->need('header.php'); ?>
1313
<html lang="zh">
14-
<body class="page-body <?php echo($_COOKIE['night'] == '1' ? 'night' : ''); ?>">
14+
<body class="page-body <?php echo isset($_COOKIE['night']) && $_COOKIE['night'] == '1' ? 'night' : ''; ?>">
1515
<div class="main-content">
1616
<div class="col-md-12">
1717
<div class="panel panel-default">

src/post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!DOCTYPE html>
44
<?php $this->need('header.php'); ?>
55
<html lang="zh">
6-
<body class="page-body <?php echo($_COOKIE['night'] == '1' ? 'night' : ''); ?>">
6+
<body class="page-body <?php echo isset($_COOKIE['night']) && $_COOKIE['night'] == '1' ? 'night' : ''; ?>">
77

88
<div class="main-content">
99
<div class="col-md-12">

0 commit comments

Comments
 (0)