diff --git a/lib/profilelist.php b/lib/profilelist.php index 4c2037e058..b17b0ac921 100644 --- a/lib/profilelist.php +++ b/lib/profilelist.php @@ -33,14 +33,15 @@ class ProfileList { function show_list() { common_element_start('ul', array('id' => 'profiles')); + + $cnt = 0; - for ($i = 0; $i < min($cnt, PROFILES_PER_PAGE); $i++) { - if ($this->profile->fetch()) { - $this->show(); - } else { - // shouldn't happen! + while ($this->profile->fetch()) { + $cnt++; + if($cnt > PROFILES_PER_PAGE) { break; } + $this->show(); } common_element_end('ul');