From 0adee465cc4d7454bc5e60f002c48b8cedb1611e Mon Sep 17 00:00:00 2001 From: joyqi Date: Tue, 10 Dec 2013 16:01:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E9=93=BE=E6=8E=A5=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- var/Widget/Archive.php | 15 +++++---------- var/Widget/Feedback.php | 4 +--- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/var/Widget/Archive.php b/var/Widget/Archive.php index bf02b5c5..d3e2949a 100644 --- a/var/Widget/Archive.php +++ b/var/Widget/Archive.php @@ -272,7 +272,6 @@ class Widget_Archive extends Widget_Abstract_Contents if ('/comments/' == $feedQuery || '/comments' == $feedQuery) { /** 专为feed使用的hack */ $this->parameter->type = 'comments'; - $this->parameter->checkPermalink = false; } else { $matched = Typecho_Router::match($this->request->feed, 'pageSize=10&isFeed=1'); if ($matched && $matched instanceof Widget_Archive) { @@ -600,12 +599,8 @@ class Widget_Archive extends Widget_Abstract_Contents { $type = $this->parameter->type; - if ('index' == $type // 首页跳转不用处理 + if (in_array($type, array('index', 'comment_page', 404)) || $this->_makeSinglePageAsFrontPage // 自定义首页不处理 - || $this->_invokeByFeed // 不要处理feed - || 'feed' == $this->parameter->type // 不处理feed - || 'comment_page' == $this->parameter->type // 不处理comment - || $this->_invokeFromOutside // 不要处理外部调用 || !$this->parameter->checkPermalink) { // 强制关闭 return; } @@ -720,7 +715,7 @@ class Widget_Archive extends Widget_Abstract_Contents { if ('comment_page' == $this->parameter->type) { $params = array(); - $matched = Typecho_Router::match($this->request->permalink, 'checkPermalink=0'); + $matched = Typecho_Router::match($this->request->permalink); if ($matched && $matched instanceof Widget_Archive && $matched->is('single')) { $this->import($matched); @@ -1320,9 +1315,6 @@ class Widget_Archive extends Widget_Abstract_Contents } } - /** 处理静态链接跳转 */ - $this->checkPermalink(); - /** 如果已经提前压入则直接返回 */ if ($hasPushed) { return; @@ -1795,6 +1787,9 @@ var TypechoComment = { */ public function render() { + /** 处理静态链接跳转 */ + $this->checkPermalink(); + /** 添加Pingback */ $this->response->setHeader('X-Pingback', $this->options->xmlRpcUrl); $validated = false; diff --git a/var/Widget/Feedback.php b/var/Widget/Feedback.php index 28b3801f..fb4cf7c8 100644 --- a/var/Widget/Feedback.php +++ b/var/Widget/Feedback.php @@ -262,9 +262,7 @@ class Widget_Feedback extends Widget_Abstract_Comments implements Widget_Interfa { /** 回调方法 */ $callback = $this->request->type; - $this->_content = Typecho_Router::match($this->request->permalink, array( - 'checkPermalink' => false - )); + $this->_content = Typecho_Router::match($this->request->permalink); /** 判断内容是否存在 */ if (false !== $this->_content && $this->_content instanceof Widget_Archive &&