[pLog-svn] r7171 - plog/branches/lifetype-1.2/class/dao

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Tue Feb 21 20:36:30 EST 2012


Author: jondaley
Date: 2012-02-21 20:36:29 -0500 (Tue, 21 Feb 2012)
New Revision: 7171

Modified:
   plog/branches/lifetype-1.2/class/dao/articlecategories.class.php
Log:
stop looping when we run out of categories

Modified: plog/branches/lifetype-1.2/class/dao/articlecategories.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/articlecategories.class.php	2012-02-21 14:33:00 UTC (rev 7170)
+++ plog/branches/lifetype-1.2/class/dao/articlecategories.class.php	2012-02-22 01:36:29 UTC (rev 7171)
@@ -70,7 +70,6 @@
 			                              $categoryName, 
         	                              CACHE_ARTICLE_CATEGORIES_BYNAME,
         	                              Array( CACHE_ARTICLE_CATEGORIES => "getId" ));
-										  									
 			// no categories
         	if( !$categories )
         		return false;
@@ -79,8 +78,7 @@
 				
 			// there might be more than one in several different blogs...
 			$found = false;
-			while( !$found ) {
-				$category = array_pop( $categories );
+			while( !$found && ($category = array_pop( $categories ))){
 				if( $blogId > -1 && $category->getBlogId() == $blogId ) {
 					$found = true;
 				}



More information about the pLog-svn mailing list