Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

官方的人来看看,难道这不BUG吗?

[复制链接]
gxuc 发表于 2013-3-14 11:05:25 | 显示全部楼层 |阅读模式
后台设置密码长度为8。但点首页的找回密码,然后打开收到的邮件重设密码地址,再设置新密码时,
可以设置任意长度的密码,刚测试过新密码为空也能提交成功。这个难道不是BUG吗?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
 楼主| gxuc 发表于 2013-3-14 11:08:06 | 显示全部楼层
以下代码写也也太不严谨咯,嘻嘻!

if($dateline < TIMESTAMP - 86400 * 3 || $operation != 1 || $idstring != $_GET['id']) {
                showmessage('getpasswd_illegal', NULL);
        }

        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');
                }

                loaducenter();
                uc_user_edit(addslashes($member['username']), $_GET['newpasswd1'], $_GET['newpasswd1'], addslashes($member['email']), 1, 0);
                $password = md5(random(10));

                if(isset($member['_inarchive'])) {
                        C::t('common_member_archive')->move_to_master($member['uid']);
                }
                C::t('common_member')->update($_GET['uid'], array('password' => $password));
                C::t('common_member_field_forum')->update($_GET['uid'], array('authstr' => ''));
                showmessage('getpasswd_succeed', 'index.php', array(), array('login' => 1));
        }
回复

使用道具 举报

下砂 发表于 2013-3-14 14:41:07 | 显示全部楼层
已反馈
回复

使用道具 举报

anamxa 发表于 2013-3-27 12:33:27 | 显示全部楼层
相逢一醉是前缘,风雨散、飘然何处。
回复

使用道具 举报

 楼主| gxuc 发表于 2013-3-29 10:46:28 | 显示全部楼层
修复方法
  1. if(!submitcheck('getpwsubmit') || $_GET['newpasswd1'] != $_GET['newpasswd2']) {
  2.                 $hashid = $_GET['id'];
  3.                 $uid = $_GET['uid'];
  4.                 include template('member/getpasswd');
  5.         } else {
  6.                 if($_GET['newpasswd1'] != addslashes($_GET['newpasswd1'])) {
  7.                         showmessage('profile_passwd_illegal');
  8.                 }
复制代码
改为
  1. if(!submitcheck('getpwsubmit')) {
  2.                 $hashid = $_GET['id'];
  3.                 $uid = $_GET['uid'];
  4.                 include template('member/getpasswd');
  5.         }elseif ($_GET['newpasswd1'] != $_GET['newpasswd2']) {
  6.                 showmessage('profile_passwd_notmatch');
  7.         }else{
  8.                 if(empty($_GET['newpasswd1']) || $_GET['newpasswd1'] != addslashes($_GET['newpasswd1'])) {
  9.                         showmessage('profile_passwd_illegal');
  10.                 }
  11.                 if(!empty($_GET['newpasswd1']) && $_G['setting']['strongpw']) {
  12.                         $strongpw_str = array();
  13.                         if(in_array(1, $_G['setting']['strongpw']) && !preg_match("/\d+/", $_GET['newpasswd1'])) {
  14.                                 $strongpw_str[] = lang('member/template', 'strongpw_1');
  15.                         }
  16.                         if(in_array(2, $_G['setting']['strongpw']) && !preg_match("/[a-z]+/", $_GET['newpasswd1'])) {
  17.                                 $strongpw_str[] = lang('member/template', 'strongpw_2');
  18.                         }
  19.                         if(in_array(3, $_G['setting']['strongpw']) && !preg_match("/[A-Z]+/", $_GET['newpasswd1'])) {
  20.                                 $strongpw_str[] = lang('member/template', 'strongpw_3');
  21.                         }
  22.                         if(in_array(4, $_G['setting']['strongpw']) && !preg_match("/[^a-zA-z0-9]+/", $_GET['newpasswd1'])) {
  23.                                 $strongpw_str[] = lang('member/template', 'strongpw_4');
  24.                         }
  25.                         if($strongpw_str) {
  26.                                 showmessage(lang('member/template', 'password_weak').implode(',', $strongpw_str));
  27.                         }
  28.                 }
  29.                 if($_G['setting']['pwlength']) {
  30.                         if(strlen($_GET['newpasswd1']) < $_G['setting']['pwlength']) {
  31.                                 showmessage('profile_password_tooshort', '', array('pwlength' => $_G['setting']['pwlength']));
  32.                         }
  33.                 }
复制代码
回复

使用道具 举报

imoko 发表于 2013-4-6 11:28:44 | 显示全部楼层
这都被你发现了啊厉害
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-3-4 12:58 , Processed in 0.024614 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表