用过Typecho的应该都清楚它本身搜索是不支持符号的,一般都会过滤掉,只会保留文字字母数字进行搜索,这种过滤应该是出于安全考虑的,但如果你的需求需要搜索符号之类的东西,则可以通过修改源码的方式实现。
首先Typecho的搜索功能是在var/Widget/Archive.php中实现的,所以需要修改两处代码
第一处
$filterKeywords = $this->request->filter('search')->get('s');
改为
$filterKeywords = $this->request->get('s');第二处
找到
$keywords = $this->request->filter('url', 'search')->keywords;
改为
$keywords = $this->request->keywords;