From: Florent Bruneau Date: Sun, 11 Apr 2010 13:42:57 +0000 (+0200) Subject: Fix Profile::getWebSite(). X-Git-Tag: xorg/1.0.0~300 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=dad856951bb8e8ecf1182f37614b0b7d2319cfdf;p=platal.git Fix Profile::getWebSite(). Signed-off-by: Florent Bruneau --- diff --git a/classes/profile.php b/classes/profile.php index 5ad9c54..44c184f 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -548,7 +548,10 @@ class Profile public function getNetworking($flags, $limit = null) { if ($this->networks == null && !$this->fetched(self::FETCH_NETWORKING)) { - $this->setNetworking($this->getProfileField(self::FETCH_NETWORKING)); + $nw = $this->getProfileField(self::FETCH_NETWORKING); + if ($nw) { + $this->setNetworking($nw); + } } if ($this->networks == null) { return array(); @@ -563,7 +566,7 @@ class Profile return null; } $site = array_pop($site); - return $site['address']; + return $site; } diff --git a/include/profilefields.inc.php b/include/profilefields.inc.php index 9af88ff..c91403d 100644 --- a/include/profilefields.inc.php +++ b/include/profilefields.inc.php @@ -452,9 +452,9 @@ class ProfileNetworking extends ProfileField foreach ($this->networks as $id => $nw) { // XXX hardcoded reference to web site index if ( - (($flags & self::NETWORKING_WEB) && $nw['network_type'] == 0) + (($flags & Profile::NETWORKING_WEB) && $nw['network_type'] == 0) || - (! ($flags & self::NETWORKING_WEB)) + (! ($flags & Profile::NETWORKING_WEB)) ) { $nws[$id] = $nw; ++$nb;