From dad856951bb8e8ecf1182f37614b0b7d2319cfdf Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 11 Apr 2010 15:42:57 +0200 Subject: [PATCH] Fix Profile::getWebSite(). Signed-off-by: Florent Bruneau --- classes/profile.php | 7 +++++-- include/profilefields.inc.php | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) 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; -- 2.1.4