修复方法- if(!submitcheck('getpwsubmit') || $_GET['newpasswd1'] != $_GET['newpasswd2']) {
- $hashid = $_GET['id'];
- $uid = $_GET['uid'];
- include template('member/getpasswd');
- } else {
- if($_GET['newpasswd1'] != addslashes($_GET['newpasswd1'])) {
- showmessage('profile_passwd_illegal');
- }
复制代码 改为- if(!submitcheck('getpwsubmit')) {
- $hashid = $_GET['id'];
- $uid = $_GET['uid'];
- include template('member/getpasswd');
- }elseif ($_GET['newpasswd1'] != $_GET['newpasswd2']) {
- showmessage('profile_passwd_notmatch');
- }else{
- if(empty($_GET['newpasswd1']) || $_GET['newpasswd1'] != addslashes($_GET['newpasswd1'])) {
- showmessage('profile_passwd_illegal');
- }
- if(!empty($_GET['newpasswd1']) && $_G['setting']['strongpw']) {
- $strongpw_str = array();
- if(in_array(1, $_G['setting']['strongpw']) && !preg_match("/\d+/", $_GET['newpasswd1'])) {
- $strongpw_str[] = lang('member/template', 'strongpw_1');
- }
- if(in_array(2, $_G['setting']['strongpw']) && !preg_match("/[a-z]+/", $_GET['newpasswd1'])) {
- $strongpw_str[] = lang('member/template', 'strongpw_2');
- }
- if(in_array(3, $_G['setting']['strongpw']) && !preg_match("/[A-Z]+/", $_GET['newpasswd1'])) {
- $strongpw_str[] = lang('member/template', 'strongpw_3');
- }
- if(in_array(4, $_G['setting']['strongpw']) && !preg_match("/[^a-zA-z0-9]+/", $_GET['newpasswd1'])) {
- $strongpw_str[] = lang('member/template', 'strongpw_4');
- }
- if($strongpw_str) {
- showmessage(lang('member/template', 'password_weak').implode(',', $strongpw_str));
- }
- }
- if($_G['setting']['pwlength']) {
- if(strlen($_GET['newpasswd1']) < $_G['setting']['pwlength']) {
- showmessage('profile_password_tooshort', '', array('pwlength' => $_G['setting']['pwlength']));
- }
- }
复制代码 |