bug位置function_core.php第2114行的ipbanned函数,估计是涉及到discuzx的所有版本啦:
function ipbanned($onlineip) { global $_G; if($_G['setting']['ipaccess'] && !ipaccess($onlineip, $_G['setting']['ipaccess'])) { return TRUE; } loadcache('ipbanned'); if(empty($_G['cache']['ipbanned'])) { return FALSE; } else { if($_G['cache']['ipbanned']['expiration'] < TIMESTAMP) { require_once libfile('function/cache'); updatecache('ipbanned'); } //modify by zhangwenbo at 2011-11-03 10:37 $onlineip = str_replace('.', '\\.', $onlineip); if(strpos($_G['cache']['ipbanned']['regexp'], $onlineip) === false) { return false; } return true; //return preg_match("/^(".$_G['cache']['ipbanned']['regexp'].")$/", $onlineip); } }错误原因:preg_match的第一个参数只能接受40066个字节的字符串,否则将出现“Warning: preg_match(): Compilation failed: regular expression is too large at offset 40066 in E:\www\test\test.php on line 6”,但对于一些大站来讲,这40066个字节是远远不够用的,因此我改如上。当然,一般的小站肯定是不会碰到这种问题的啦,呵呵...
文章详细介绍了在DiscuzX中,ipbanned函数在处理大站IP访问限制时遇到的匹配长度限制问题,并提供了解决方案。
2659

被折叠的 条评论
为什么被折叠?



