Sets email_directory to NULL when there's none.
authorStéphane Jacob <jacou@melix.net>
Mon, 21 Jul 2008 06:11:01 +0000 (08:11 +0200)
committerStéphane Jacob <jacou@melix.net>
Tue, 22 Jul 2008 07:30:57 +0000 (09:30 +0200)
modules/profile/general.inc.php

index aa0fe1c..335a854 100644 (file)
@@ -361,6 +361,9 @@ class ProfileGeneral extends ProfilePage
         if ($this->changed['email_directory']) {
             $new_email = ($this->values['email_directory'] == "new@new.new") ?
                 $this->values['email_directory_new'] : $this->values['email_directory'];
+            if ($new_email == "") {
+                $new_email = NULL;
+            }
             XDB::execute("REPLACE INTO  profile_directory (uid, email_directory)
                                 VALUES  ({?}, {?})",
                          S::v('uid'), $new_email);