@@ -59,7 +59,7 @@ class ResellerController extends Zend_Controller_Action
5959 * @var SpamFilter_PanelSupport_Cpanel
6060 */
6161 protected $ _panel ;
62-
62+
6363 public function init ()
6464 {
6565 try {
@@ -135,19 +135,19 @@ public function listdomainsAction()
135135 $ config = Zend_Registry::get ('general_config ' );
136136 $ this ->view ->isConfigured = (!empty ($ config ->apiuser )) ? true : false ;
137137 if (!$ this ->view ->isConfigured ) { return false ; }
138-
138+
139139 // Items Per Page functionality
140140 $ itemsPerPage = $ this ->_getParam ('items ' )? (int )htmlspecialchars ($ this ->_getParam ('items ' )) : 25 ;
141141 if ($ itemsPerPage <1 || $ itemsPerPage > 25 ){
142142 $ this ->view ->itemsPerPageLimit = $ this ->t ->_ ('The items per page parameter should be an integer greater than or equal to 1 and less than or equal to 25 ' );
143143 $ itemsPerPage = 25 ;
144144 }
145-
145+
146146 // Get params
147147 $ filter = htmlspecialchars ($ this ->_getParam ('search ' ));
148148 $ order = $ this ->_getParam ('sortorder ' );
149149 $ oldorder = SpamFilter_Panel_Cache::get ( 'domains_sort_order ' );
150-
150+
151151 // Get domain from cache if not root
152152 if (SpamFilter_Core::getUsername () != 'root ' ){
153153 $ domains = SpamFilter_Panel_Cache::get (SpamFilter_Core::getDomainsCacheId ());
@@ -162,8 +162,8 @@ public function listdomainsAction()
162162 if ($ order != $ oldorder ) {
163163 $ domains = $ this ->_panel ->getSortedDomains (array ('domains ' => $ domains , 'order ' => $ order ));
164164 SpamFilter_Panel_Cache::set (SpamFilter_Core::getDomainsCacheId (), $ domains );
165- }
166-
165+ }
166+
167167 // No cache set, proceed with retrieval
168168 if (empty ($ domains )) {
169169 $ domains = $ this ->_panel ->getDomains (
@@ -177,7 +177,7 @@ public function listdomainsAction()
177177 // Cache miss, save the data
178178 SpamFilter_Panel_Cache::set (SpamFilter_Core::getDomainsCacheId (), $ domains );
179179 }
180-
180+
181181 // Proceed
182182 if ( !isset ($ domains ))
183183 {
@@ -190,7 +190,7 @@ public function listdomainsAction()
190190 return false ;
191191 }
192192
193- if ((empty ($ domains )) || (count ($ domains ) == 0 ) )
193+ if ((empty ($ domains )) || (is_countable ( $ domains ) && count ($ domains ) = == 0 ) )
194194 {
195195 $ this ->_flashMessenger ->addMessage (
196196 array (
@@ -200,11 +200,11 @@ public function listdomainsAction()
200200 );
201201 return false ;
202202 }
203-
203+
204204 if (!empty ($ filter )){
205205 $ domains = $ this ->_panel ->filterDomains (array ('domains ' => $ domains , 'filter ' => $ filter ));
206206 }
207- if ((empty ($ domains )) || (count ($ domains ) == 0 ) )
207+ if ((empty ($ domains )) || (is_countable ( $ domains ) && count ($ domains ) == 0 ) )
208208 {
209209 $ this ->_flashMessenger ->addMessage (
210210 array (
@@ -257,7 +257,7 @@ public function listaccountsAction()
257257 }
258258
259259 // Proceed
260- if ( (!isset ($ accounts )) || (empty ($ accounts )) || (count ($ accounts ) == 0 ) )
260+ if ( (!isset ($ accounts )) || (empty ($ accounts )) || (is_countable ( $ accounts ) && count ($ accounts ) == 0 ) )
261261 {
262262 $ this ->_flashMessenger ->addMessage (
263263 array (
0 commit comments