From 468cbd7f4a814af7e9ba8a7bfe65496c1fc8c6a7 Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Sun, 20 Dec 2009 20:07:59 +0000
Subject: [PATCH] - Patch #502968 by Ryan Palmer: increase maximum allowable
 length of email addresses.

---
 modules/user/user.install | 10 +++++++++-
 modules/user/user.module  |  2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/modules/user/user.install b/modules/user/user.install
index c93cf0e9eb3d..1f57dac91524 100644
--- a/modules/user/user.install
+++ b/modules/user/user.install
@@ -124,7 +124,7 @@ function user_schema() {
       ),
       'mail' => array(
         'type' => 'varchar',
-        'length' => 64,
+        'length' => 254,
         'not null' => FALSE,
         'default' => '',
         'description' => "User's email address.",
@@ -478,6 +478,14 @@ function user_update_7004(&$sandbox) {
   }
 }
 
+/**
+ * Change the users table to allow longer email addresses - 254 characters instead of 64.
+ */
+function user_update_7005(&$sandbox) {
+  $schema = user_schema();
+  db_change_field('users', 'mail', 'mail', $schema['users']['fields']['mail']);
+}
+
 /**
  * @} End of "defgroup user-updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
diff --git a/modules/user/user.module b/modules/user/user.module
index 66bdf17fece3..f56bbe29beeb 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -14,7 +14,7 @@
 /**
  * Maximum length of user e-mail text field.
  */
-define('EMAIL_MAX_LENGTH', 64);
+define('EMAIL_MAX_LENGTH', 254);
 
 /**
  * Implement hook_help().
-- 
GitLab