本帖最后由 mark35 于 2014-3-3 17:07 编辑
日志中错误代码
- 2014/03/03 16:36:55 [error] 27932#0: *11905642 FastCGI sent in stderr: "PHP message: PHP Warning: mt_rand(): max(11) is smaller than min(12) in /www/uc_server/lib/seccode.class.php on line 240" while reading response header from upstream, client: , server: [url]xiaozhong.biz[/url], request: "GET /uc_server/admin.php?m=seccode&seccodeauth=29b67b912kFav4ophdfvdbwA4&1618523580 HTTP/1.1",
复制代码
程序中代码 uc_server/lib/seccode.class.php
- $x = mt_rand( $font[0]['angle'] > 0 ? cos(deg2rad(90 - $font[0]['angle'])) * $font[0]['zheight'] : 1, $this->width - $widthtotal);
复制代码
解决办法:判断输入值大小
- $v1 = $font[0]['angle'] > 0 ? cos(deg2rad(90 - $font[0]['angle'])) * $font[0]['zheight'] : 1;
- $v2 = $this->width - $widthtotal;
- $x = mt_rand(min($v1, $v2), max($v1, $v2));
- unset($v1, $v2);
复制代码
|