X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fprofile.php;h=53d91009079eb8da4c965e4ca36959cedbd50ff8;hb=b270577e919c58455a3629a4d9d61bd38ea49e11;hp=c2cb842a9ac14bb468d0039972a44922348fe886;hpb=3e2442cdad23f14739209ec77a417e89694fa0b8;p=platal.git diff --git a/classes/profile.php b/classes/profile.php index c2cb842..53d9100 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -197,7 +197,11 @@ class Profile public function mainEducation() { - return $this->promo{0}; + if (empty($this->promo)) { + return null; + } else { + return $this->promo{0}; + } } public function mainEducationDuration() @@ -447,7 +451,10 @@ class Profile public function getAddresses($flags, $limit = null) { if ($this->addresses == null && !$this->fetched(self::FETCH_ADDRESSES)) { - $this->setAddresses($this->getProfileField(self::FETCH_ADDRESSES)); + $addr = $this->getProfileField(self::FETCH_ADDRESSES); + if ($addr) { + $this->setAddresses($addr); + } } if ($this->addresses == null) { @@ -544,7 +551,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(); @@ -559,7 +569,7 @@ class Profile return null; } $site = array_pop($site); - return $site['address']; + return $site; } @@ -575,7 +585,10 @@ class Profile public function getJobs($flags, $limit = null) { if ($this->jobs == null && !$this->fetched(self::FETCH_JOBS)) { - $this->setJobs($this->getProfileField(self::FETCH_JOBS)); + $jobs = $this->getProfileField(self::FETCH_JOBS); + if ($jobs) { + $this->setJobs($jobs); + } } if ($this->jobs == null) {