It may rarely happen that no filters are registered. It is strange but it may
authorRoland Haeder <roland@mxchange.org>
Sun, 22 Mar 2015 20:11:33 +0000 (21:11 +0100)
committerRoland Haeder <roland@mxchange.org>
Sun, 22 Mar 2015 20:11:33 +0000 (21:11 +0100)
happen.

Signed-off-by: Roland H├Ąder <roland@mxchange.org>
.gitignore
inc/classes/main/filter/class_FilterChain.php
inc/classes/main/response/class_BaseResponse.php

index e4688a2..5c62d8f 100644 (file)
@@ -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
index b061f3c..1c24333 100644 (file)
@@ -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;
        }
 
        /**
index 7fdbebb..bd75248 100644 (file)
@@ -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 {