AlanJia2017 Publish time 2018-07-05 15:58

815版本更新中checkrobot函数preg_match() 少了一个参数

本帖最后由 AlanJia2017 于 2018-7-5 18:37 编辑

source\function\function_core.php中checkrobot函数
原本代码
if(strpos($useragent, 'http://') === false && dstrpos($useragent, $kw_browsers)) return false;815版本更新后的代码
if(preg_match('/https?:\/\//is') && dstrpos($useragent, $kw_browsers)) return false;preg_match少了一个参数。

正确的应该是这样 ?
if(!preg_match('/https?:\/\//is',$useragent) && dstrpos($useragent, $kw_browsers)) return false;且,最好是做http的兼容,比如是这样子。if(!preg_match('/^(http:\/\/|https:\/\/).*$/',$useragent) && dstrpos($useragent, $kw_browsers)) return false;搜索引擎的UA有的还是留的http协议的。
比如百度的:
https://ziyuan.baidu.com/wiki/990

题外话想说的是,815更新的https细节修正似乎根本没有为http留下任何余地。不考虑兼容?自己的网站强制https没问题,但是第三方网站就不好说了。你确定所有第三方链接都100%是https协议的?


vot Publish time 2018-07-05 20:22

First of all look at rev.#821 where this bug is fixed.
In the second your concerns about https are vain,
because the regular expression preg_match('/https?:\/\//is',$useragent) means "http OR https" :)

AlanJia2017 Publish time 2018-07-06 10:53

static/image/common/user_online.gif vot static/image/common/clock.gif 2018-7-5 20:22
First of all look at rev.#821 where this bug is fixed.
In the second your concerns about https are v ...

谢大佬回复:lol
闹笑话了
Pages: [1]
View full version: 815版本更新中checkrobot函数preg_match() 少了一个参数