我目前正在使用 Drupal 函数 drupal_execute 来注册用户,但是密码值似乎只记录了保存在数据库中的第一个字符。
$form_state = array();
$form_state['values'] = array(
'name' => strtolower(preg_replace("'\W'", "", $person->firstName) . $person->entityId),
'mail' => $person->emailPrimary,
'pass' => user_password(),
'status' => 1,
'roles' => $roles,
'notify' => 1,
);
drupal_execute('user_register', $form_state, NULL);
打印出 form_state 数组表明密码设置正确,长度为 10 个字符。
谁能阐明为什么只有传递值的第一个字符被保存到数据库中?
谢谢。G