diff --git a/admin/login.php b/admin/login.php index 2df246f6..ea05271a 100644 --- a/admin/login.php +++ b/admin/login.php @@ -16,8 +16,8 @@ include 'header.php';

- - + +

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'); diff --git a/var/Typecho/Db.php b/var/Typecho/Db.php index 5e4e5a0c..2805825d 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 76467a79..2f3e5688 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 5a55aeef..a752eb7c 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 d9294efc..d26c9fbc 100644 --- a/var/Typecho/Db/Adapter/Pgsql.php +++ b/var/Typecho/Db/Adapter/Pgsql.php @@ -110,9 +110,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;