summaryrefslogtreecommitdiff
path: root/modules/user/user.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/user/user.module')
-rw-r--r--modules/user/user.module9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index 0611c53e6..d15bfcdee 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -961,6 +961,15 @@ function user_user_validate(&$edit, &$account, $category = NULL) {
form_set_error('mail', t('The e-mail address %email is already registered. <a href="@password">Have you forgotten your password?</a>', array('%email' => $edit['mail'], '@password' => url('user/password'))));
}
}
+
+ // Make sure the signature isn't longer than the size of the database field.
+ // Signatures are disabled by default, so make sure it exists first.
+ if (isset($edit['signature'])) {
+ $user_schema = drupal_get_schema('users');
+ if (strlen($edit['signature']) > $user_schema['fields']['signature']['length']) {
+ form_set_error('signature', t('The signature is too long: it must be %max characters or less.', array('%max' => $user_schema['fields']['signature']['length'])));
+ }
+ }
}
}