From 3933a23ad7e65ae0aa9e63009cce501b900bccd6 Mon Sep 17 00:00:00 2001
From: Luffy <52o@qq52o.cn>
Date: Mon, 26 Feb 2024 11:52:17 +0800
Subject: [PATCH 1/2] Fix assign null to property
Widget\Archive::$archiveKeywords (#1738)
* Fix assign null to property Widget\Archive::$archiveKeywords
* Fix
---
var/Widget/Archive.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/var/Widget/Archive.php b/var/Widget/Archive.php
index 2620f927bc..3b1e726e89 100644
--- a/var/Widget/Archive.php
+++ b/var/Widget/Archive.php
@@ -114,14 +114,14 @@ class Archive extends Contents
/**
* 本页关键字
*
- * @var string
+ * @var string|null
*/
- private string $archiveKeywords;
+ private ?string $archiveKeywords = null;
/**
* 本页描述
*
- * @var string
+ * @var string|null
*/
private ?string $archiveDescription = null;
@@ -1023,7 +1023,7 @@ public function header(?string $rule = null)
$header .= '' . "\n";
$header .= '' . "\n";
+ . htmlspecialchars($this->archiveDescription ?? ($this->options->description ?? '')) . '" />' . "\n";
$header .= '' . "\n";
$header .= '' . "\n";
$header .= '' . "\n";
From d84e261f7b9ed10c74e792edc596a18cf5a3ab47 Mon Sep 17 00:00:00 2001
From: Luffy <52o@qq52o.cn>
Date: Wed, 28 Feb 2024 10:57:47 +0800
Subject: [PATCH 2/2] Fix missing get date (#1740)
---
var/Widget/Base/Contents.php | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/var/Widget/Base/Contents.php b/var/Widget/Base/Contents.php
index b8f595459b..9123896244 100644
--- a/var/Widget/Base/Contents.php
+++ b/var/Widget/Base/Contents.php
@@ -70,6 +70,9 @@
* @property-read string $commentUrl
* @property-read string $trackbackUrl
* @property-read string $responseUrl
+ * @property-read string $year
+ * @property-read string $month
+ * @property-read string $day
*/
class Contents extends Base implements QueryInterface, RowFilterInterface, PrimaryKeyInterface, ParamsDelegateInterface
{
@@ -923,4 +926,28 @@ protected function ___responseUrl(): string
{
return $this->permalink . '#' . $this->respondId;
}
+
+ /**
+ * @return string
+ */
+ protected function ___year(): string
+ {
+ return $this->date->year;
+ }
+
+ /**
+ * @return string
+ */
+ protected function ___month(): string
+ {
+ return $this->date->month;
+ }
+
+ /**
+ * @return string
+ */
+ protected function ___day(): string
+ {
+ return $this->date->day;
+ }
}