From: Roland Haeder Date: Sun, 22 Mar 2015 20:11:33 +0000 (+0100) Subject: It may rarely happen that no filters are registered. It is strange but it may X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=25f3d336c291b783f803f0795a610a509fcbaf54;p=core.git It may rarely happen that no filters are registered. It is strange but it may happen. Signed-off-by: Roland Häder --- diff --git a/.gitignore b/.gitignore index e4688a2d..5c62d8f6 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,11 @@ inc/config/config-local.php templates/_compiled/*.* templates/images/_cache/*.* *.*~ +/.cache +/.project +/.settings +application/*/config-local.php +db/*/*.serialized +docs/html/* +docs/latex/* +docs/warn.log diff --git a/inc/classes/main/filter/class_FilterChain.php b/inc/classes/main/filter/class_FilterChain.php index b061f3c5..1c243331 100644 --- a/inc/classes/main/filter/class_FilterChain.php +++ b/inc/classes/main/filter/class_FilterChain.php @@ -56,12 +56,22 @@ class FilterChain extends BaseFrameworkSystem implements Registerable { } /** - * Getter for filters array + * "Getter" for filters array * * @return $filters The filters array holding all filter instances */ protected function getFilters () { - return $this->getGenericArrayKey('filters', 'generic', 'dummy'); + // Default is nothing found + $filters = array(); + + // Are some filters set? + if ($this->isValidGenericArrayKey('filters', 'generic', 'dummy')) { + // Then get them + $filters = $this->getGenericArrayKey('filters', 'generic', 'dummy'); + } // END - if + + // Return it + return $filters; } /** diff --git a/inc/classes/main/response/class_BaseResponse.php b/inc/classes/main/response/class_BaseResponse.php index 7fdbebb4..bd752489 100644 --- a/inc/classes/main/response/class_BaseResponse.php +++ b/inc/classes/main/response/class_BaseResponse.php @@ -181,7 +181,7 @@ class BaseResponse extends BaseFrameworkSystem { } // Are there some error messages? - if ($this->countGenericArrayElements('fatal_messages', 'generic', 'message') == 0) { + if ((!$this->isValidGenericArrayKey('fatal_messages', 'generic', 'message')) || ($this->countGenericArrayElements('fatal_messages', 'generic', 'message') == 0)) { // Flush the output to the world $this->getWebOutputInstance()->output($this->responseBody); } else {