From 272fc8b3e1f0a680926599d38059e60363a4854c Mon Sep 17 00:00:00 2001 From: jrotty Date: Fri, 29 Sep 2023 02:12:11 -0500 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E4=B9=9F=E5=8F=AF=E4=BB=A5=E7=99=BB=E9=99=86=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=20(#1631)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 😭用了八年,今天翻代码才知道也可以用邮箱登陆 --- admin/login.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/login.php b/admin/login.php index e6ad36c7..c5312d4a 100644 --- a/admin/login.php +++ b/admin/login.php @@ -16,8 +16,8 @@ include 'header.php';

- - + +

From 5f52c1e25bb1c14a17ddc1e0b02729b48418448d Mon Sep 17 00:00:00 2001 From: Lu Fei <52o@qq52o.cn> Date: Tue, 3 Oct 2023 11:12:46 +0800 Subject: [PATCH 2/3] Fix null argument issue (#1633) --- admin/register.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/register.php b/admin/register.php index 642b8bc5..c3be8980 100644 --- a/admin/register.php +++ b/admin/register.php @@ -4,8 +4,8 @@ include 'common.php'; if ($user->hasLogin() || !$options->allowRegister) { $response->redirect($options->siteUrl); } -$rememberName = htmlspecialchars(\Typecho\Cookie::get('__typecho_remember_name')); -$rememberMail = htmlspecialchars(\Typecho\Cookie::get('__typecho_remember_mail')); +$rememberName = htmlspecialchars(\Typecho\Cookie::get('__typecho_remember_name', '')); +$rememberMail = htmlspecialchars(\Typecho\Cookie::get('__typecho_remember_mail', '')); \Typecho\Cookie::delete('__typecho_remember_name'); \Typecho\Cookie::delete('__typecho_remember_mail'); From 99212ec78743317bf52063fb165b90fceb70de5e Mon Sep 17 00:00:00 2001 From: joyqi Date: Tue, 3 Oct 2023 11:14:04 +0800 Subject: [PATCH 3/3] fix #1635 (#1636) --- var/Typecho/Db.php | 4 ++-- var/Typecho/Db/Adapter.php | 4 ++-- var/Typecho/Db/Adapter/Mysqli.php | 4 ++-- var/Typecho/Db/Adapter/Pdo.php | 4 ++-- var/Typecho/Db/Adapter/Pdo/SQLite.php | 4 ++-- var/Typecho/Db/Adapter/Pgsql.php | 4 ++-- var/Typecho/Db/Adapter/SQLite.php | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/var/Typecho/Db.php b/var/Typecho/Db.php index 547d9ccb..c0e1e687 100644 --- a/var/Typecho/Db.php +++ b/var/Typecho/Db.php @@ -449,10 +449,10 @@ class Db * * @param mixed $query 查询对象 * @param array|null $filter 行过滤器函数,将查询的每一行作为第一个参数传入指定的过滤器中 - * @return object|null + * @return \stdClass|null * @throws DbException */ - public function fetchObject($query, ?array $filter = null): ?object + public function fetchObject($query, ?array $filter = null): ?\stdClass { $resource = $this->query($query); diff --git a/var/Typecho/Db/Adapter.php b/var/Typecho/Db/Adapter.php index 6ab95e7b..69585dbe 100644 --- a/var/Typecho/Db/Adapter.php +++ b/var/Typecho/Db/Adapter.php @@ -84,9 +84,9 @@ interface Adapter * 将数据查询的其中一行作为对象取出,其中字段名对应对象属性 * * @param resource $resource 查询的资源数据 - * @return object|null + * @return \stdClass|null */ - public function fetchObject($resource): ?object; + public function fetchObject($resource): ?\stdClass; /** * 引号转义函数 diff --git a/var/Typecho/Db/Adapter/Mysqli.php b/var/Typecho/Db/Adapter/Mysqli.php index d40a232d..0f3c3ce1 100644 --- a/var/Typecho/Db/Adapter/Mysqli.php +++ b/var/Typecho/Db/Adapter/Mysqli.php @@ -152,9 +152,9 @@ class Mysqli implements Adapter * 将数据查询的其中一行作为对象取出,其中字段名对应对象属性 * * @param \mysqli_result $resource 查询的资源数据 - * @return object|null + * @return \stdClass|null */ - public function fetchObject($resource): ?object + public function fetchObject($resource): ?\stdClass { return $resource->fetch_object(); } diff --git a/var/Typecho/Db/Adapter/Pdo.php b/var/Typecho/Db/Adapter/Pdo.php index 3041c55c..9dc25716 100644 --- a/var/Typecho/Db/Adapter/Pdo.php +++ b/var/Typecho/Db/Adapter/Pdo.php @@ -140,9 +140,9 @@ abstract class Pdo implements Adapter * 将数据查询的其中一行作为对象取出,其中字段名对应对象属性 * * @param \PDOStatement $resource 查询的资源数据 - * @return object|null + * @return \stdClass|null */ - public function fetchObject($resource): ?object + public function fetchObject($resource): ?\stdClass { return $resource->fetchObject() ?: null; } diff --git a/var/Typecho/Db/Adapter/Pdo/SQLite.php b/var/Typecho/Db/Adapter/Pdo/SQLite.php index 01c8ea1f..a46806ee 100644 --- a/var/Typecho/Db/Adapter/Pdo/SQLite.php +++ b/var/Typecho/Db/Adapter/Pdo/SQLite.php @@ -48,9 +48,9 @@ class SQLite extends Pdo * 将数据查询的其中一行作为对象取出,其中字段名对应对象属性 * * @param \PDOStatement $resource 查询的资源数据 - * @return object|null + * @return \stdClass|null */ - public function fetchObject($resource): ?object + public function fetchObject($resource): ?\stdClass { $result = $this->fetch($resource); return $result ? (object) $result : null; diff --git a/var/Typecho/Db/Adapter/Pgsql.php b/var/Typecho/Db/Adapter/Pgsql.php index c97d488f..764c41e4 100644 --- a/var/Typecho/Db/Adapter/Pgsql.php +++ b/var/Typecho/Db/Adapter/Pgsql.php @@ -106,9 +106,9 @@ class Pgsql implements Adapter * 将数据查询的其中一行作为对象取出,其中字段名对应对象属性 * * @param resource $resource 查询的资源数据 - * @return object|null + * @return \stdClass|null */ - public function fetchObject($resource): ?object + public function fetchObject($resource): ?\stdClass { return pg_fetch_object($resource) ?: null; } diff --git a/var/Typecho/Db/Adapter/SQLite.php b/var/Typecho/Db/Adapter/SQLite.php index dd4b071f..9d16952b 100644 --- a/var/Typecho/Db/Adapter/SQLite.php +++ b/var/Typecho/Db/Adapter/SQLite.php @@ -92,9 +92,9 @@ class SQLite implements Adapter * 将数据查询的其中一行作为对象取出,其中字段名对应对象属性 * * @param \SQLite3Result $resource 查询的资源数据 - * @return object|null + * @return \stdClass|null */ - public function fetchObject($resource): ?object + public function fetchObject($resource): ?\stdClass { $result = $this->fetch($resource); return $result ? (object) $result : null;