Fix networking selection for profile display
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Tue, 6 Jul 2010 20:22:04 +0000 (22:22 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Tue, 6 Jul 2010 20:22:04 +0000 (22:22 +0200)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
include/profilefields.inc.php

index 83f3fb0..27ffeb2 100644 (file)
@@ -528,16 +528,13 @@ class ProfileNetworking extends ProfileField
 
     public function get($flags, $limit = null)
     {
-        if (!$flags) {
-            $flags = Profile::NETWORKING_ALL;
-        }
         $nws = array();
         $nb = 0;
         foreach ($this->networks as $id => $nw) {
             if (($flags & Profile::NETWORKING_WEB) && $nw['network_type']->hasFlag('web') ||
                 ($flags & Profile::NETWORKING_IM) && $nw['network_type']->hasFlag('im') ||
                 ($flags & Profile::NETWORKING_SOCIAL) && $nw['network_type']->hasFlag('social') ||
-                ($flags & Profile::NETWORKING_ALL)) {
+                ($flags == Profile::NETWORKING_ALL)) {
                 $nws[$id] = $nw;
                 ++$nb;
                 if (isset($limit) && $nb >= $limit) {