Fix a bug in email rewrite update which is set to 0 instead of ''
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 2 Feb 2007 20:14:30 +0000 (20:14 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 2 Feb 2007 20:14:30 +0000 (20:14 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1469 839d8a87-29fc-0310-9880-83ba4fa771e5

include/emails.inc.php

index 838aa6c..1732d9d 100644 (file)
@@ -171,6 +171,9 @@ class Email
         if ($this->rewrite == $rew) {
             return;
         }
+        if (!$rew || !isvalid_email($rew)) {
+            $rew = '';
+        }
         XDB::execute('UPDATE emails SET rewrite={?} WHERE uid={?} AND email={?}', $rew, $uid, $this->email);
         $this->rewrite = $rew;
         return;