diff --git a/var/Widget/Base/Contents.php b/var/Widget/Base/Contents.php index 61ef983f..e052d5bb 100644 --- a/var/Widget/Base/Contents.php +++ b/var/Widget/Base/Contents.php @@ -147,12 +147,12 @@ class Contents extends Base implements QueryInterface /** * 为内容应用缩略名 * - * @param string $slug 缩略名 + * @param string|null $slug 缩略名 * @param mixed $cid 内容id * @return string * @throws Exception */ - public function applySlug(string $slug, $cid): string + public function applySlug(?string $slug, $cid): string { if ($cid instanceof Query) { $cid = $this->db->fetchObject($cid->select('cid') diff --git a/var/Widget/Contents/Post/Edit.php b/var/Widget/Contents/Post/Edit.php index adc997e4..8002f1cc 100644 --- a/var/Widget/Contents/Post/Edit.php +++ b/var/Widget/Contents/Post/Edit.php @@ -548,12 +548,12 @@ class Edit extends Contents implements ActionInterface * 设置内容标签 * * @param integer $cid - * @param string $tags + * @param string|null $tags * @param boolean $beforeCount 是否参与计数 * @param boolean $afterCount 是否参与计数 * @throws DbException */ - public function setTags(int $cid, string $tags, bool $beforeCount = true, bool $afterCount = true) + public function setTags(int $cid, ?string $tags, bool $beforeCount = true, bool $afterCount = true) { $tags = str_replace(',', ',', $tags); $tags = array_unique(array_map('trim', explode(',', $tags))); @@ -1023,7 +1023,7 @@ class Edit extends Contents implements ActionInterface protected function ___draft(): ?array { if ($this->have()) { - if ('post_draft' == $this->type) { + if ('post_draft' == $this->type || 'page_draft' == $this->type) { return $this->row; } else { return $this->db->fetchRow(Contents::alloc()->select() diff --git a/var/Widget/Options.php b/var/Widget/Options.php index f1a0fa44..c189379d 100644 --- a/var/Widget/Options.php +++ b/var/Widget/Options.php @@ -33,6 +33,7 @@ if (!defined('__TYPECHO_ROOT_DIR__')) { * @property string $pluginUrl * @property string $adminUrl * @property string $loginUrl + * @property string $originalSiteUrl * @property string $loginAction * @property string $registerUrl * @property string $registerAction @@ -48,6 +49,7 @@ if (!defined('__TYPECHO_ROOT_DIR__')) { * @property int $timezone * @property string $charset * @property string $contentType + * @property string $generator * @property string $software * @property string $version * @property bool $markdown @@ -61,6 +63,33 @@ if (!defined('__TYPECHO_ROOT_DIR__')) { * @property string $actionTable * @property string $panelTable * @property bool $commentsThreaded + * @property bool $defaultAllowComment + * @property bool $defaultAllowPing + * @property bool $defaultAllowFeed + * @property string $commentDateFormat + * @property string $commentsAvatarRating + * @property string $commentsPageDisplay + * @property int $commentsPageSize + * @property string $commentsOrder + * @property bool $commentsMarkdown + * @property bool $commentsShowUrl + * @property bool $commentsUrlNofollow + * @property bool $commentsAvatar + * @property bool $commentsPageBreak + * @property bool $commentsRequireModeration + * @property bool $commentsWhitelist + * @property bool $commentsRequireMail + * @property bool $commentsRequireURL + * @property bool $commentsCheckReferer + * @property bool $commentsAntiSpam + * @property bool $commentsAutoClose + * @property bool $commentsPostIntervalEnable + * @property string $commentsHTMLTagAllowed + * @property bool $allowRegister + * @property bool $allowXmlRpc + * @property int $postsListSize + * @property bool $feedFullText + * @property int $defaultCategory */ class Options extends Base { diff --git a/var/Widget/Options/Discussion.php b/var/Widget/Options/Discussion.php index 80c89668..df9d84c2 100644 --- a/var/Widget/Options/Discussion.php +++ b/var/Widget/Options/Discussion.php @@ -256,15 +256,23 @@ class Discussion extends Options implements ActionInterface $commentsPostOptionsValue[] = 'commentsPostIntervalEnable'; } - $commentsPost = new Form\Element\Checkbox('commentsPost', $commentsPostOptions, - $commentsPostOptionsValue, _t('评论提交')); + $commentsPost = new Form\Element\Checkbox( + 'commentsPost', + $commentsPostOptions, + $commentsPostOptionsValue, + _t('评论提交') + ); $form->addInput($commentsPost->multiMode()); /** 允许使用的HTML标签和属性 */ - $commentsHTMLTagAllowed = new Form\Element\Textarea('commentsHTMLTagAllowed', null, + $commentsHTMLTagAllowed = new Form\Element\Textarea( + 'commentsHTMLTagAllowed', + null, $this->options->commentsHTMLTagAllowed, - _t('允许使用的HTML标签和属性'), _t('默认的用户评论不允许填写任何的HTML标签, 你可以在这里填写允许使用的HTML标签.') . '
' - . _t('比如: %s', '<a href=""> <img src=""> <blockquote>')); + _t('允许使用的HTML标签和属性'), + _t('默认的用户评论不允许填写任何的HTML标签, 你可以在这里填写允许使用的HTML标签.') . '
' + . _t('比如: %s', '<a href=""> <img src=""> <blockquote>') + ); $commentsHTMLTagAllowed->input->setAttribute('class', 'mono'); $form->addInput($commentsHTMLTagAllowed); diff --git a/var/Widget/Options/Permalink.php b/var/Widget/Options/Permalink.php index a38bbe05..705e5e7b 100644 --- a/var/Widget/Options/Permalink.php +++ b/var/Widget/Options/Permalink.php @@ -245,7 +245,8 @@ RewriteRule . {$basePath}index.php [L] } elseif (!isset($patterns[$postPatternValue])) { $customPatternValue = $this->decodeRule($postPatternValue); } - $patterns['custom'] = _t('个性化定义') . ' '; + $patterns['custom'] = _t('个性化定义') . + ' '; $postPattern = new Form\Element\Radio( 'postPattern', diff --git a/var/Widget/Upload.php b/var/Widget/Upload.php index 266d901d..f733b052 100644 --- a/var/Widget/Upload.php +++ b/var/Widget/Upload.php @@ -429,7 +429,7 @@ class Upload extends Contents implements ActionInterface * @param string $ext 扩展名 * @return boolean */ - public static function checkFileType($ext) + public static function checkFileType(string $ext): bool { $options = Options::alloc(); return in_array($ext, $options->allowedAttachmentTypes);