Added assert() + commented in debug lines
[core.git] / inc / classes / main / criteria / class_BaseCriteria.php
index 929b048f9c84815ab6edcc17e4fad281bbc30fa5..9e1be5b05980271290263e806eb673ef01845f20 100644 (file)
@@ -358,6 +358,8 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                foreach ($this->getGenericArrayKey('criteria', $criteriaType, 'entries') as $criteriaKey => $criteriaValue) {
                        // Make sure no 'my-' or 'my_' passes this point
                        assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue)));
+
+                       // $criteriaValue cannot be an array
                        assert(!is_array($criteriaValue));
 
                        // Convert dashes to underscore
@@ -366,7 +368,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                        // Is the value in array or is $onlyKeys empty?
                        if ((isset($onlyKeys[$criteriaKey])) || (count($onlyKeys) == 0)) {
                                // Add the value URL encoded to avoid any trouble with special characters
-                               $cacheKey .= sprintf("%s=%s;",
+                               $cacheKey .= sprintf('%s=%s;',
                                        $criteriaKey,
                                        urlencode($criteriaValue)
                                );
@@ -381,7 +383,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                        // Check if 'limit' and 'skip' are in
                        if (((isset($onlyKeys['limit'])) && (isset($onlyKeys['skip']))) || (count($onlyKeys) == 0)) {
                                // Add limit and skip values
-                               $cacheKey .= sprintf(";%%limit%%=%s;%%skip%%=%s",
+                               $cacheKey .= sprintf(';%%limit%%=%s;%%skip%%=%s',
                                        $this->getLimit(),
                                        $this->getSkip()
                                );