X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fcriteria%2Fclass_BaseCriteria.php;h=9e1be5b05980271290263e806eb673ef01845f20;hp=929b048f9c84815ab6edcc17e4fad281bbc30fa5;hb=c5a8985c0be3a5a8a5b99a625596b9861f8d63de;hpb=66e68715d3d5a5e7fd5a3046471914ef3f9dd4b4 diff --git a/inc/classes/main/criteria/class_BaseCriteria.php b/inc/classes/main/criteria/class_BaseCriteria.php index 929b048f..9e1be5b0 100644 --- a/inc/classes/main/criteria/class_BaseCriteria.php +++ b/inc/classes/main/criteria/class_BaseCriteria.php @@ -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() );