用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2849|回复: 1
收起左侧

[讨论/交流] 验证类有bug?

[复制链接]
发表于 2009-11-6 10:19:59 | 显示全部楼层 |阅读模式
'user/insert'=>array(
  array(
   'field' => 'user_name',
   'label' => 'lang:th_name',
   'rules' => 'required'
  ),
  array(
   'field' => 'email',
   'label' => 'lang:th_email',
   'rules' => 'required|valid_email'
  ),
  array(
   'field' => 'password',
   'label' => 'lang:th_password',
   'rules' => 'required'
  ),
  array(
   'field' => 'confirm_pwd',
   'label' => 'lang:th_confirm_pwd',
   'rules' => 'required|matches[password]'
  ),
)
验证密码的时候会出现The Confirm field does not match the lang:th_password field.
lang:th_password解析不了
CI_Form_validation类671行原来的是
$message = sprintf($line, $this->_translate_fieldname($row['label']), $param);
改成
$message = sprintf($line, $this->_translate_fieldname($row['label']), $this->_translate_fieldname($param));
发表于 2009-11-6 10:58:13 | 显示全部楼层
有可能,看一下官方 bug list 是不是已经提交过了,呵呵

本版积分规则