From: Florent Bruneau Date: Wed, 6 Oct 2010 08:20:09 +0000 (+0200) Subject: Fix initialisation of Address::flags: the flags where built only for X-Git-Tag: xorg/1.0.1~95 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=545bc699496f01cf1b5db97ca3ca19999222ba1b;p=platal.git Fix initialisation of Address::flags: the flags where built only for personal adresses leading to errors when calling Address::hasFlag() on an address attached to a job. Signed-off-by: Florent Bruneau --- diff --git a/classes/address.php b/classes/address.php index 0eac92c..08c313c 100644 --- a/classes/address.php +++ b/classes/address.php @@ -102,21 +102,19 @@ class Address } } - if ($this->type == self::LINK_PROFILE) { - if (!is_null($this->flags)) { - $this->flags = new PlFlagSet($this->flags); - } else { - static $flags = array('current', 'temporary', 'secondary', 'mail'); - - $this->flags = new PlFlagSet(); - foreach ($flags as $flag) { - if (!is_null($this->$flag) && ($this->$flag == 1 || $this->$flag == 'on')) { - $this->flags->addFlag($flag, 1); - $this->$flag = null; - } - $this->flags->addFlag('cedex', (strpos(strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"), - array('', "\n"), $this->text)), 'CEDEX')) !== false); + if (!is_null($this->flags)) { + $this->flags = new PlFlagSet($this->flags); + } else { + static $flags = array('current', 'temporary', 'secondary', 'mail'); + + $this->flags = new PlFlagSet(); + foreach ($flags as $flag) { + if (!is_null($this->$flag) && ($this->$flag == 1 || $this->$flag == 'on')) { + $this->flags->addFlag($flag, 1); + $this->$flag = null; } + $this->flags->addFlag('cedex', (strpos(strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"), + array('', "\n"), $this->text)), 'CEDEX')) !== false); } } }