------------------------------------------------------------
revno: 1054
committer: Roger Martin <[email protected]>
branch nick: aikiframework
timestamp: Sun 2012-01-29 23:37:26 +0100
message:
  check results before using them in foreach
modified:
  libs/aiki.php


--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk

Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to 
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'libs/aiki.php'
--- libs/aiki.php	2012-01-10 22:55:09 +0000
+++ libs/aiki.php	2012-01-29 22:37:26 +0000
@@ -135,17 +135,19 @@
 
 		// go through every config record. if the config item
 		// is not already set then use the database record
-		foreach ($settings as $setting_group) {
-
-			// unserialize array key => value pairs stored
-			// in this config group. Every row should be an array
-			// of config items pertaining to a config group
-			$temp = @unserialize($setting_group->config_data);
-
-			if (is_array($temp)) {
-				// adding arrays doesn't overwrite the first parameter/array with
-				// the values of the second parameter/array when the keys match
-				$config = $config + $temp;
+		if ( !is_null($settings) ) {
+			foreach ($settings as $setting_group) {
+
+				// unserialize array key => value pairs stored
+				// in this config group. Every row should be an array
+				// of config items pertaining to a config group
+				$temp = @unserialize($setting_group->config_data);
+
+				if (is_array($temp)) {
+					// adding arrays doesn't overwrite the first parameter/array with
+					// the values of the second parameter/array when the keys match
+					$config = $config + $temp;
+				}
 			}
 		}
 

_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help   : https://help.launchpad.net/ListHelp

Reply via email to