Fix Profile::getWebSite().
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 11 Apr 2010 13:42:57 +0000 (15:42 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 11 Apr 2010 13:42:57 +0000 (15:42 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/profile.php
include/profilefields.inc.php

index 5ad9c54..44c184f 100644 (file)
@@ -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;
     }
 
 
index 9af88ff..c91403d 100644 (file)
@@ -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;