Fixed searched criteria handling #3
[core.git] / inc / classes / main / database / databases / class_LocalFileDatabase.php
index e45b294..7aa3fb3 100644 (file)
@@ -357,6 +357,9 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
 
                                        // Search in the criteria with FMFW (First Matches, First Wins)
                                        foreach ($dataArray as $key => $value) {
+                                               // Make sure value is not bool
+                                               assert(!is_bool($value));
+
                                                // Found one entry?
                                                $isFound = (($isFound === TRUE) && ($searchInstance->isCriteriaMatching($key, $value)));
                                                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: key=' . $key . ',value=' . $value . ',isFound=' . intval($isFound));
@@ -492,6 +495,9 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
 
                                        // Search in the criteria with FMFW (First Matches, First Wins)
                                        foreach ($dataArray as $key => $value) {
+                                               // Make sure value is not bool
+                                               assert(!is_bool($value));
+
                                                // Found one entry?
                                                $isFound = (($isFound === TRUE) && ($searchInstance->isCriteriaMatching($key, $value)));
                                        } // END - foreach
@@ -510,6 +516,10 @@ class LocalFileDatabase extends BaseDatabaseBackend implements DatabaseBackendIn
 
                                                // Entry found, so update it
                                                foreach ($searchArray as $searchKey => $searchValue) {
+                                                       // Make sure the value is not bool again
+                                                       assert(!is_bool($searchValue));
+
+                                                       // Debug message + add/update it
                                                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DATABASE: criteriaKey=' . $searchKey . ',criteriaValue=' . $searchValue);
                                                        $dataArray[$searchKey] = $searchValue;
                                                } // END - foreach