时间:2天前
首页的开发版,官方皮肤是正常的,但其他大量皮肤搜索功能都出现异常
开发板的GitHub说明
var/Widget/Archive.php
@@ -1189,8 +1189,14 @@ private function searchHandle(Typecho_Db_Query $select, &$hasPushed)
代码: 全选
$searchQuery = '%' . str_replace(' ', '%', $keywords) . '%';
/** 搜索无法进入隐私项保护归档 */
- $select->where("table.contents.password IS NULL OR table.contents.password = ''")
- ->where('table.contents.title LIKE ? OR table.contents.text LIKE ?', $searchQuery, $searchQuery)
+ if ($this->user->hasLogin()) {
+ //~ fix issue 941
+ $select->where("table.contents.password IS NULL OR table.contents.password = '' OR talble.contents.authorId = ?", $this->user->uid);
+ } else {
+ $select->where("table.contents.password IS NULL OR table.contents.password = ''");
+ }
+
+ $select->where('table.contents.title LIKE ? OR table.contents.text LIKE ?', $searchQuery, $searchQuery)
->where('table.contents.type = ?', 'post');
}