Commit 9f83f604 authored by hass's avatar hass

Move trim later as other modules may cause db insert/update failures.

parent 495fed86
......@@ -331,13 +331,13 @@ function realname_update($account) {
// Remove double spaces (if a token had no value).
$realname = preg_replace('/ {2,}/', ' ', $realname);
// Allow other modules to alter the generated realname.
drupal_alter('realname', $realname, $account);
// The name must be trimmed to 255 characters before inserting into the
// database.
$realname = truncate_utf8(trim($realname), 255);
// Allow other modules to alter the generated realname.
drupal_alter('realname', $realname, $account);
// Save to the database and the static cache.
db_merge('realname')
->key(array('uid' => $account->uid))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment