[pLog-svn] r2460 - plog/trunk/class/dao

oscar at devel.plogworld.net oscar at devel.plogworld.net
Fri Sep 9 12:30:08 GMT 2005


Author: oscar
Date: 2005-09-09 12:30:07 +0000 (Fri, 09 Sep 2005)
New Revision: 2460

Modified:
   plog/trunk/class/dao/articles.class.php
Log:
added an extra check so that we make sure that we're processing an array


Modified: plog/trunk/class/dao/articles.class.php
===================================================================
--- plog/trunk/class/dao/articles.class.php	2005-09-09 12:27:05 UTC (rev 2459)
+++ plog/trunk/class/dao/articles.class.php	2005-09-09 12:30:07 UTC (rev 2460)
@@ -653,12 +653,14 @@
 
             // and save the custom fields
             $customFields = new CustomFieldsValues();
-            foreach( $fields as $field ) {
-                $customFields->addCustomFieldValue( $field->getFieldId(), 
-                                                    $field->getValue(), 
-                                                    $artId, 
-                                                    $blogId );
-            }
+            if( is_array( $fields )) {
+            	foreach( $fields as $field ) {
+                	$customFields->addCustomFieldValue( $field->getFieldId(), 
+                    	                                $field->getValue(), 
+                        	                            $artId, 
+                            	                        $blogId );
+            	}
+        	}
             
             // update the blog counters
             if( $newArticle->getStatus() == POST_STATUS_PUBLISHED ) {




More information about the pLog-svn mailing list