diff --git a/doc/source/config.rst b/doc/source/config.rst index e209ecbe..8fd90977 100644 --- a/doc/source/config.rst +++ b/doc/source/config.rst @@ -50,6 +50,14 @@ To sum up, you should put this in your ``php.ini``: And the **snuffleupagus rules** into the ``.rules`` files. +Since our configuration format is a bit more complex than php's one, +we have a ``sp.allow_broken_configuration`` parameter (``false`` by default), +that you can set to ``true`` if you want PHP to carry on if your Snuffleupagus' +configuration contains syntax errors. You'll still get a big scary message in +your logs of course. We do **not** recommend to use it of course, but sometimes +it might be useful to be able to "debug in production" without breaking your +website. + Miscellaneous ------------- @@ -70,6 +78,7 @@ This configuration variable contains parameters that are used by multiple featur - ``cookie_env_var``: A environment variable used as part of cookies encryption. See the :ref:`relevant documentation ` + Bugclass-killer features ------------------------ diff --git a/src/php_snuffleupagus.h b/src/php_snuffleupagus.h index 41d9b77b..50957e5f 100644 --- a/src/php_snuffleupagus.h +++ b/src/php_snuffleupagus.h @@ -65,6 +65,7 @@ ZEND_BEGIN_MODULE_GLOBALS(snuffleupagus) size_t in_eval; sp_config config; bool is_config_valid; +bool allow_broken_configuration; HashTable *disabled_functions_hook; HashTable *sp_internal_functions_hook; HashTable *sp_eval_blacklist_functions_hook; diff --git a/src/snuffleupagus.c b/src/snuffleupagus.c index 5ef8323b..4fee81aa 100644 --- a/src/snuffleupagus.c +++ b/src/snuffleupagus.c @@ -34,9 +34,21 @@ static inline void sp_op_array_handler(zend_op_array *op) { ZEND_DECLARE_MODULE_GLOBALS(snuffleupagus) +static PHP_INI_MH(StrictMode) { + TSRMLS_FETCH(); + + SNUFFLEUPAGUS_G(allow_broken_configuration) = false; + if (new_value && zend_string_equals_literal(new_value, "1")) { + SNUFFLEUPAGUS_G(allow_broken_configuration) = true; + } + return SUCCESS; +} + PHP_INI_BEGIN() PHP_INI_ENTRY("sp.configuration_file", "", PHP_INI_SYSTEM, OnUpdateConfiguration) +PHP_INI_ENTRY("sp.allow_broken_configuration", "0", PHP_INI_SYSTEM, + StrictMode) PHP_INI_END() void free_disabled_functions_hashtable(HashTable *ht) { @@ -181,6 +193,10 @@ PHP_RINIT_FUNCTION(snuffleupagus) { ZEND_TSRMLS_CACHE_UPDATE(); #endif + if (!SNUFFLEUPAGUS_G(allow_broken_configuration) && !SNUFFLEUPAGUS_G(is_config_valid)) { + sp_log_err("config", "Invalid configuration file"); + } + // We need to disable wrappers loaded by extensions loaded after SNUFFLEUPAGUS. if (SNUFFLEUPAGUS_G(config).config_wrapper->enabled && zend_hash_num_elements(php_stream_get_url_stream_wrappers_hash()) != diff --git a/src/tests/broken_conf.phpt b/src/tests/broken_conf.phpt index 981f982a..209e1bd9 100644 --- a/src/tests/broken_conf.phpt +++ b/src/tests/broken_conf.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] Invalid configuration prefix for 'this is a broken line' on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid configuration prefix for 'this is a broken line' on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid configuration prefix for 'this is a broken line' on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf2.phpt b/src/tests/broken_conf2.phpt index 240e3afa..47314d14 100644 --- a/src/tests/broken_conf2.phpt +++ b/src/tests/broken_conf2.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf2.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] Invalid configuration section 'sp.wrong' on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid configuration section 'sp.wrong' on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid configuration section 'sp.wrong' on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_allow_broken_disabled.phpt b/src/tests/broken_conf_allow_broken_disabled.phpt new file mode 100644 index 00000000..7aa0c824 --- /dev/null +++ b/src/tests/broken_conf_allow_broken_disabled.phpt @@ -0,0 +1,18 @@ +--TEST-- +Broken configuration with allow broken turned off +--SKIPIF-- + +--INI-- +sp.configuration_file={PWD}/config/broken_conf.ini +sp.allow_broken_configuration=Off +--FILE-- + +--EXPECT-- +PHP Fatal error: [snuffleupagus][config] Invalid configuration prefix for 'this is a broken line' on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration prefix for 'this is a broken line' on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. diff --git a/src/tests/broken_conf_allow_broken_enabled.phpt b/src/tests/broken_conf_allow_broken_enabled.phpt new file mode 100644 index 00000000..452595b9 --- /dev/null +++ b/src/tests/broken_conf_allow_broken_enabled.phpt @@ -0,0 +1,16 @@ +--TEST-- +Broken configuration with allow broken turned on +--SKIPIF-- + +--INI-- +sp.configuration_file={PWD}/config/broken_conf.ini +sp.allow_broken_configuration=On +--FILE-- + +--EXPECT-- +PHP Fatal error: [snuffleupagus][config] Invalid configuration prefix for 'this is a broken line' on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration prefix for 'this is a broken line' on line 1 in Unknown on line 0 +1337 diff --git a/src/tests/broken_conf_config_regexp.phpt b/src/tests/broken_conf_config_regexp.phpt index c4e788e1..2977e3ab 100644 --- a/src/tests/broken_conf_config_regexp.phpt +++ b/src/tests/broken_conf_config_regexp.phpt @@ -12,3 +12,6 @@ PHP Fatal error: [snuffleupagus][config] '.filename_r()' is expecting a valid r Fatal error: [snuffleupagus][config] Failed to compile '*.': %s on line 1. in Unknown on line 0 Fatal error: [snuffleupagus][config] '.filename_r()' is expecting a valid regexp, and not '"*."' on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. diff --git a/src/tests/broken_conf_config_regexp_no_closing_paren.phpt b/src/tests/broken_conf_config_regexp_no_closing_paren.phpt index 16351a40..77bb1b46 100644 --- a/src/tests/broken_conf_config_regexp_no_closing_paren.phpt +++ b/src/tests/broken_conf_config_regexp_no_closing_paren.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] '.filename_r()' is expecting a valid r Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"*."': it doesn't look like a valid string on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] '.filename_r()' is expecting a valid regexp, and not '"*."' on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] '.filename_r()' is expecting a valid regexp, and not '"*."' on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_cookie_name_and_regexp.phpt b/src/tests/broken_conf_cookie_name_and_regexp.phpt index ae3fa62e..b1e1318b 100644 --- a/src/tests/broken_conf_cookie_name_and_regexp.phpt +++ b/src/tests/broken_conf_cookie_name_and_regexp.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_cookie_name_and_regexp.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] name and name_r are mutually exclusive on line 2 in Unknown on line 0 -Fatal error: [snuffleupagus][config] name and name_r are mutually exclusive on line 2 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] name and name_r are mutually exclusive on line 2 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_enable_disable.phpt b/src/tests/broken_conf_enable_disable.phpt index f96e7379..a836f444 100644 --- a/src/tests/broken_conf_enable_disable.phpt +++ b/src/tests/broken_conf_enable_disable.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/borken_conf_enable_disable.ini --EXPECTF-- PHP Fatal error: [snuffleupagus][config] A rule can't be enabled and disabled on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] A rule can't be enabled and disabled on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] A rule can't be enabled and disabled on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_eval.phpt b/src/tests/broken_conf_eval.phpt index 6ba7f8fe..98da9c91 100644 --- a/src/tests/broken_conf_eval.phpt +++ b/src/tests/broken_conf_eval.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_eval.ini --EXPECT-- PHP Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"cos,sin': it doesn't look like a valid string on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"cos,sin': it doesn't look like a valid string on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"cos,sin': it doesn't look like a valid string on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_expecting_bool.phpt b/src/tests/broken_conf_expecting_bool.phpt index 261ce6e2..6770c7c9 100644 --- a/src/tests/broken_conf_expecting_bool.phpt +++ b/src/tests/broken_conf_expecting_bool.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_expecting_bool.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] Trailing chars '337);' at the end of '.enable(1337);' on line 5 in Unknown on line 0 -Fatal error: [snuffleupagus][config] Trailing chars '337);' at the end of '.enable(1337);' on line 5 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Trailing chars '337);' at the end of '.enable(1337);' on line 5 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_invalid_cidr.phpt b/src/tests/broken_conf_invalid_cidr.phpt index ccf4026e..3e270504 100644 --- a/src/tests/broken_conf_invalid_cidr.phpt +++ b/src/tests/broken_conf_invalid_cidr.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_invalid_cidr.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] '42' isn't a valid ipv4 mask. in Unknown on line 0 -Fatal error: [snuffleupagus][config] '42' isn't a valid ipv4 mask. in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] '42' isn't a valid ipv4 mask. in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_invalid_cidr6.phpt b/src/tests/broken_conf_invalid_cidr6.phpt index 802f9f29..8f966698 100644 --- a/src/tests/broken_conf_invalid_cidr6.phpt +++ b/src/tests/broken_conf_invalid_cidr6.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_invalid_cidr6.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] 'ZZZ' isn't a valid network mask. in Unknown on line 0 -Fatal error: [snuffleupagus][config] 'ZZZ' isn't a valid network mask. in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] 'ZZZ' isn't a valid network mask. in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_invalid_cidr6_no_slash.phpt b/src/tests/broken_conf_invalid_cidr6_no_slash.phpt index 02e52011..2d557ff8 100644 --- a/src/tests/broken_conf_invalid_cidr6_no_slash.phpt +++ b/src/tests/broken_conf_invalid_cidr6_no_slash.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_invalid_cidr6_no_slash.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] '2001:0db8:0000:0000:0000:ff00:0042:8329' isn't a valid network mask, it seems that you forgot a '/'. in Unknown on line 0 -Fatal error: [snuffleupagus][config] '2001:0db8:0000:0000:0000:ff00:0042:8329' isn't a valid network mask, it seems that you forgot a '/'. in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] '2001:0db8:0000:0000:0000:ff00:0042:8329' isn't a valid network mask, it seems that you forgot a '/'. in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_invalid_cidr_value.phpt b/src/tests/broken_conf_invalid_cidr_value.phpt index c9666564..ad609129 100644 --- a/src/tests/broken_conf_invalid_cidr_value.phpt +++ b/src/tests/broken_conf_invalid_cidr_value.phpt @@ -12,4 +12,7 @@ PHP Fatal error: [snuffleupagus][config] " doesn't contain a valid cidr on line Fatal error: [snuffleupagus][error] A valid string as parameter is expected on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] " doesn't contain a valid cidr on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] " doesn't contain a valid cidr on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_invalid_filename.phpt b/src/tests/broken_conf_invalid_filename.phpt index f02db983..0ab138f2 100644 --- a/src/tests/broken_conf_invalid_filename.phpt +++ b/src/tests/broken_conf_invalid_filename.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_invalid_filename.ini --EXPECTF-- PHP Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.function("sprintf").filename("wrong file name").drop();':'.filename' must be an absolute path or a phar archive on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.function("sprintf").filename("wrong file name").drop();':'.filename' must be an absolute path or a phar archive on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.function("sprintf").filename("wrong file name").drop();':'.filename' must be an absolute path or a phar archive on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_invalid_type.phpt b/src/tests/broken_conf_invalid_type.phpt index 6bb6f507..b140c25b 100644 --- a/src/tests/broken_conf_invalid_type.phpt +++ b/src/tests/broken_conf_invalid_type.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_invalid_type.ini --EXPECTF-- PHP Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"totally_wrong"_type")': it doesn't look like a valid string on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"totally_wrong"_type")': it doesn't look like a valid string on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"totally_wrong"_type")': it doesn't look like a valid string on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_key_value.phpt b/src/tests/broken_conf_key_value.phpt index 50dbb2bb..8c455f88 100644 --- a/src/tests/broken_conf_key_value.phpt +++ b/src/tests/broken_conf_key_value.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_key_value.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.function("system").var("").value("").key("").drop();':`key` and `value` are mutually exclusive on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.function("system").var("").value("").key("").drop();':`key` and `value` are mutually exclusive on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.function("system").var("").value("").key("").drop();':`key` and `value` are mutually exclusive on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_line_empty_string.phpt b/src/tests/broken_conf_line_empty_string.phpt index 9bc20c71..77bd46d2 100644 --- a/src/tests/broken_conf_line_empty_string.phpt +++ b/src/tests/broken_conf_line_empty_string.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_line_empty_string.ini --EXPECT-- PHP Fatal error: [snuffleupagus][error] A valid string as parameter is expected on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][error] A valid string as parameter is expected on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][error] A valid string as parameter is expected on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_line_no_closing.phpt b/src/tests/broken_conf_line_no_closing.phpt index 999c655c..19dd081f 100644 --- a/src/tests/broken_conf_line_no_closing.phpt +++ b/src/tests/broken_conf_line_no_closing.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_line_no_closing.ini --EXPECT-- PHP Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"123"': it doesn't look like a valid string on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"123"': it doesn't look like a valid string on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"123"': it doesn't look like a valid string on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_1.phpt b/src/tests/broken_conf_local_var_1.phpt index 9a22eb99..52494d3e 100644 --- a/src/tests/broken_conf_local_var_1.phpt +++ b/src/tests/broken_conf_local_var_1.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value ']' for `var` on line 1 Fatal error: [snuffleupagus][config] Invalid `]` position. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value ']' for `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value ']' for `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_10.phpt b/src/tests/broken_conf_local_var_10.phpt index 9efea61a..d1842869 100644 --- a/src/tests/broken_conf_local_var_10.phpt +++ b/src/tests/broken_conf_local_var_10.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value 'asd[asd]asd' for `var` Fatal error: [snuffleupagus][config] Invalid `]` position. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value 'asd[asd]asd' for `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value 'asd[asd]asd' for `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_11.phpt b/src/tests/broken_conf_local_var_11.phpt index 4d8aa8be..105ef241 100644 --- a/src/tests/broken_conf_local_var_11.phpt +++ b/src/tests/broken_conf_local_var_11.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value 'asd::' for `param` on l Fatal error: [snuffleupagus][config] Invalid `::` position. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value 'asd::' for `param` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value 'asd::' for `param` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_12.phpt b/src/tests/broken_conf_local_var_12.phpt index b893740f..bfa79e16 100644 --- a/src/tests/broken_conf_local_var_12.phpt +++ b/src/tests/broken_conf_local_var_12.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_local_var_12.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] Empty value in `var` on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] Empty value in `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Empty value in `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_13.phpt b/src/tests/broken_conf_local_var_13.phpt index 5a1f4316..b4e8deef 100644 --- a/src/tests/broken_conf_local_var_13.phpt +++ b/src/tests/broken_conf_local_var_13.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value 'asd->asd' for `var` on Fatal error: [snuffleupagus][config] Invalid `->` position. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value 'asd->asd' for `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value 'asd->asd' for `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_14.phpt b/src/tests/broken_conf_local_var_14.phpt index 330c603c..3e217211 100644 --- a/src/tests/broken_conf_local_var_14.phpt +++ b/src/tests/broken_conf_local_var_14.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value '$i+valid var name ' for Fatal error: [snuffleupagus][config] Invalid var name: $i+valid var name . in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value '$i+valid var name ' for `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value '$i+valid var name ' for `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_15.phpt b/src/tests/broken_conf_local_var_15.phpt index fd4319c3..6c9c4c36 100644 --- a/src/tests/broken_conf_local_var_15.phpt +++ b/src/tests/broken_conf_local_var_15.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value '$i$$!@#->qwe' for `var` Fatal error: [snuffleupagus][config] Invalid var name: $i$$!@#. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value '$i$$!@#->qwe' for `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value '$i$$!@#->qwe' for `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_16.phpt b/src/tests/broken_conf_local_var_16.phpt index e27caab8..85c66274 100644 --- a/src/tests/broken_conf_local_var_16.phpt +++ b/src/tests/broken_conf_local_var_16.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value '"' for `var` on line 1 Fatal error: [snuffleupagus][config] Missing a closing quote. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value '"' for `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value '"' for `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_2.phpt b/src/tests/broken_conf_local_var_2.phpt index aa458b38..7b0d36bd 100644 --- a/src/tests/broken_conf_local_var_2.phpt +++ b/src/tests/broken_conf_local_var_2.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value '""asd' for `var` on lin Fatal error: [snuffleupagus][config] Invalid `"` position. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value '""asd' for `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value '""asd' for `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_3.phpt b/src/tests/broken_conf_local_var_3.phpt index fb365c9f..fb00c268 100644 --- a/src/tests/broken_conf_local_var_3.phpt +++ b/src/tests/broken_conf_local_var_3.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value '$qwe->::' for `var` on Fatal error: [snuffleupagus][config] Invalid `->` position. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value '$qwe->::' for `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value '$qwe->::' for `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_4.phpt b/src/tests/broken_conf_local_var_4.phpt index b8ec75e5..8d7e195f 100644 --- a/src/tests/broken_conf_local_var_4.phpt +++ b/src/tests/broken_conf_local_var_4.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value '"asd"asd[]' for `var` o Fatal error: [snuffleupagus][config] Invalid `"` position. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value '"asd"asd[]' for `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value '"asd"asd[]' for `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_5.phpt b/src/tests/broken_conf_local_var_5.phpt index 65daf259..1c62e371 100644 --- a/src/tests/broken_conf_local_var_5.phpt +++ b/src/tests/broken_conf_local_var_5.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value ''asd'asd[]' for `var` o Fatal error: [snuffleupagus][config] Invalid `'` position. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value ''asd'asd[]' for `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value ''asd'asd[]' for `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_6.phpt b/src/tests/broken_conf_local_var_6.phpt index 0e21d6bc..9a3fa02d 100644 --- a/src/tests/broken_conf_local_var_6.phpt +++ b/src/tests/broken_conf_local_var_6.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value '''asd' for `var` on lin Fatal error: [snuffleupagus][config] Invalid `'` position. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value '''asd' for `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value '''asd' for `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_7.phpt b/src/tests/broken_conf_local_var_7.phpt index 596764cd..9f2548be 100644 --- a/src/tests/broken_conf_local_var_7.phpt +++ b/src/tests/broken_conf_local_var_7.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value 'asd-->' for `var` on li Fatal error: [snuffleupagus][config] Invalid `->` position. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value 'asd-->' for `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value 'asd-->' for `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_8.phpt b/src/tests/broken_conf_local_var_8.phpt index 00069ecb..d4d9d352 100644 --- a/src/tests/broken_conf_local_var_8.phpt +++ b/src/tests/broken_conf_local_var_8.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value 'asd[asd]"asd"' for `var Fatal error: [snuffleupagus][config] Invalid `]` position. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value 'asd[asd]"asd"' for `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value 'asd[asd]"asd"' for `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_local_var_9.phpt b/src/tests/broken_conf_local_var_9.phpt index 7536e306..972e3982 100644 --- a/src/tests/broken_conf_local_var_9.phpt +++ b/src/tests/broken_conf_local_var_9.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value 'asd[asd]'asd'' for `var Fatal error: [snuffleupagus][config] Invalid `]` position. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value 'asd[asd]'asd'' for `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value 'asd[asd]'asd'' for `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_lots_of_quotes.phpt b/src/tests/broken_conf_lots_of_quotes.phpt index e11d54b7..afed2f84 100644 --- a/src/tests/broken_conf_lots_of_quotes.phpt +++ b/src/tests/broken_conf_lots_of_quotes.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_lots_of_quotes.ini --EXPECT-- PHP Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"this\"is a weird\"\"\"cookie\"name"");': it doesn't look like a valid string on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"this\"is a weird\"\"\"cookie\"name"");': it doesn't look like a valid string on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"this\"is a weird\"\"\"cookie\"name"");': it doesn't look like a valid string on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_missing_script.phpt b/src/tests/broken_conf_missing_script.phpt index 2166d3bc..70e508d7 100644 --- a/src/tests/broken_conf_missing_script.phpt +++ b/src/tests/broken_conf_missing_script.phpt @@ -11,4 +11,6 @@ echo 1; PHP Fatal error: [snuffleupagus][config] The `script` directive is mandatory in '.enable();' on line 1 in Unknown on line 0 Fatal error: [snuffleupagus][config] The `script` directive is mandatory in '.enable();' on line 1 in Unknown on line 0 -1 \ No newline at end of file + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. diff --git a/src/tests/broken_conf_mutually_exclusive10.phpt b/src/tests/broken_conf_mutually_exclusive10.phpt index a9c15d71..0231c059 100644 --- a/src/tests/broken_conf_mutually_exclusive10.phpt +++ b/src/tests/broken_conf_mutually_exclusive10.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive10.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] A rule can't be enabled and disabled on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] A rule can't be enabled and disabled on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] A rule can't be enabled and disabled on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_mutually_exclusive4.phpt b/src/tests/broken_conf_mutually_exclusive4.phpt index 82b2dcc1..c979f563 100644 --- a/src/tests/broken_conf_mutually_exclusive4.phpt +++ b/src/tests/broken_conf_mutually_exclusive4.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive4.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").param_r("^id$").drop();':'.r_param', '.param' and '.pos' are mutually exclusive on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").param_r("^id$").drop();':'.r_param', '.param' and '.pos' are mutually exclusive on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").param_r("^id$").drop();':'.r_param', '.param' and '.pos' are mutually exclusive on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_mutually_exclusive6.phpt b/src/tests/broken_conf_mutually_exclusive6.phpt index 7f6466c4..1c4686b9 100644 --- a/src/tests/broken_conf_mutually_exclusive6.phpt +++ b/src/tests/broken_conf_mutually_exclusive6.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive6.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").ret_r("^0$").drop();':`ret` and `param` are mutually exclusive on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").ret_r("^0$").drop();':`ret` and `param` are mutually exclusive on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.function("system").param("id").value("42").ret_r("^0$").drop();':`ret` and `param` are mutually exclusive on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_mutually_exclusive7.phpt b/src/tests/broken_conf_mutually_exclusive7.phpt index 1d659597..22abf793 100644 --- a/src/tests/broken_conf_mutually_exclusive7.phpt +++ b/src/tests/broken_conf_mutually_exclusive7.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive7.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.function("system").ret("0").drop().allow();': The rule must either be a `drop` or `allow` one on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.function("system").ret("0").drop().allow();': The rule must either be a `drop` or `allow` one on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.function("system").ret("0").drop().allow();': The rule must either be a `drop` or `allow` one on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_mutually_exclusive8.phpt b/src/tests/broken_conf_mutually_exclusive8.phpt index 67824608..6a95234d 100644 --- a/src/tests/broken_conf_mutually_exclusive8.phpt +++ b/src/tests/broken_conf_mutually_exclusive8.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive8.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.ret("0").drop();': must take a function name on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.ret("0").drop();': must take a function name on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid configuration line: 'sp.disabled_functions.ret("0").drop();': must take a function name on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_mutually_exclusive9.phpt b/src/tests/broken_conf_mutually_exclusive9.phpt index 400852d0..9436c24f 100644 --- a/src/tests/broken_conf_mutually_exclusive9.phpt +++ b/src/tests/broken_conf_mutually_exclusive9.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_mutually_exclusive9.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] A rule can't be enabled and disabled on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] A rule can't be enabled and disabled on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] A rule can't be enabled and disabled on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_no_cookie_action.phpt b/src/tests/broken_conf_no_cookie_action.phpt index 3085d9e5..a354b8b6 100644 --- a/src/tests/broken_conf_no_cookie_action.phpt +++ b/src/tests/broken_conf_no_cookie_action.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_cookie_action.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] You must specify a at least one action to a cookie on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] You must specify a at least one action to a cookie on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] You must specify a at least one action to a cookie on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_no_cookie_name.phpt b/src/tests/broken_conf_no_cookie_name.phpt index 91541249..e769edbe 100644 --- a/src/tests/broken_conf_no_cookie_name.phpt +++ b/src/tests/broken_conf_no_cookie_name.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/config_encrypted_cookies_noname.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] You must specify a cookie name/regexp on line 2 in Unknown on line 0 -Fatal error: [snuffleupagus][config] You must specify a cookie name/regexp on line 2 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] You must specify a cookie name/regexp on line 2 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_no_file_specified.phpt b/src/tests/broken_conf_no_file_specified.phpt index df33072f..10314ec4 100644 --- a/src/tests/broken_conf_no_file_specified.phpt +++ b/src/tests/broken_conf_no_file_specified.phpt @@ -6,4 +6,5 @@ Broken configuration - No configuration file specified --FILE-- --EXPECT-- -1 +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. diff --git a/src/tests/broken_conf_nonexisting_script.phpt b/src/tests/broken_conf_nonexisting_script.phpt index 68ca0013..16583d37 100644 --- a/src/tests/broken_conf_nonexisting_script.phpt +++ b/src/tests/broken_conf_nonexisting_script.phpt @@ -11,4 +11,6 @@ echo 1; PHP Fatal error: [snuffleupagus][config] The `script` (./non_existing_script.sh) doesn't exist on line 1 in Unknown on line 0 Fatal error: [snuffleupagus][config] The `script` (./non_existing_script.sh) doesn't exist on line 1 in Unknown on line 0 -1 \ No newline at end of file + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. diff --git a/src/tests/broken_conf_quotes.phpt b/src/tests/broken_conf_quotes.phpt index ed2c87fa..845f7ee5 100644 --- a/src/tests/broken_conf_quotes.phpt +++ b/src/tests/broken_conf_quotes.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value '_SERVER[PHP_SELF' for ` Fatal error: [snuffleupagus][config] You forgot to close a bracket. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value '_SERVER[PHP_SELF' for `var` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value '_SERVER[PHP_SELF' for `var` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_readonly_exec.phpt b/src/tests/broken_conf_readonly_exec.phpt index 56881da4..cc5758f1 100644 --- a/src/tests/broken_conf_readonly_exec.phpt +++ b/src/tests/broken_conf_readonly_exec.phpt @@ -11,4 +11,6 @@ echo 1; PHP Fatal error: [snuffleupagus][config] Trailing chars '234);' at the end of '.enable(1234);' on line 1 in Unknown on line 0 Fatal error: [snuffleupagus][config] Trailing chars '234);' at the end of '.enable(1234);' on line 1 in Unknown on line 0 -1 \ No newline at end of file + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. diff --git a/src/tests/broken_conf_samesite.phpt b/src/tests/broken_conf_samesite.phpt index a7c341fd..99965d4b 100644 --- a/src/tests/broken_conf_samesite.phpt +++ b/src/tests/broken_conf_samesite.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_cookie_samesite.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] nop is an invalid value to samesite (expected Lax or Strict) on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] nop is an invalid value to samesite (expected Lax or Strict) on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] nop is an invalid value to samesite (expected Lax or Strict) on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_shown_in_phpinfo.phpt b/src/tests/broken_conf_shown_in_phpinfo.phpt index 0a0ceb86..eb7eae62 100644 --- a/src/tests/broken_conf_shown_in_phpinfo.phpt +++ b/src/tests/broken_conf_shown_in_phpinfo.phpt @@ -23,4 +23,6 @@ PHP Fatal error: [snuffleupagus][config] '.filename_r()' is expecting a valid r Fatal error: [snuffleupagus][config] Failed to compile '*.': %s on line 1. in Unknown on line 0 Fatal error: [snuffleupagus][config] '.filename_r()' is expecting a valid regexp, and not '"*."' on line 1 in Unknown on line 0 -win + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. diff --git a/src/tests/broken_conf_truncated.phpt b/src/tests/broken_conf_truncated.phpt index 83d76339..f0c5887b 100644 --- a/src/tests/broken_conf_truncated.phpt +++ b/src/tests/broken_conf_truncated.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/config_broken_conf_truncated.ini --EXPECT-- PHP Fatal error: [snuffleupagus][error] A valid string as parameter is expected on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][error] A valid string as parameter is expected on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][error] A valid string as parameter is expected on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_unserialize.phpt b/src/tests/broken_conf_unserialize.phpt index e6781b14..d7a924a2 100644 --- a/src/tests/broken_conf_unserialize.phpt +++ b/src/tests/broken_conf_unserialize.phpt @@ -11,4 +11,6 @@ echo 1; PHP Fatal error: [snuffleupagus][config] Trailing chars '234);' at the end of '.enable(1234);' on line 1 in Unknown on line 0 Fatal error: [snuffleupagus][config] Trailing chars '234);' at the end of '.enable(1234);' on line 1 in Unknown on line 0 -1 \ No newline at end of file + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. diff --git a/src/tests/broken_conf_upload_validation.phpt b/src/tests/broken_conf_upload_validation.phpt index ea74a5a2..332a649e 100644 --- a/src/tests/broken_conf_upload_validation.phpt +++ b/src/tests/broken_conf_upload_validation.phpt @@ -11,4 +11,6 @@ echo 1; PHP Fatal error: [snuffleupagus][error] A valid string as parameter is expected on line 1 in Unknown on line 0 Fatal error: [snuffleupagus][error] A valid string as parameter is expected on line 1 in Unknown on line 0 -1 \ No newline at end of file + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. diff --git a/src/tests/broken_conf_weird_keyword.phpt b/src/tests/broken_conf_weird_keyword.phpt index 3a456f59..e3c12395 100644 --- a/src/tests/broken_conf_weird_keyword.phpt +++ b/src/tests/broken_conf_weird_keyword.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_weird_keyword.ini --EXPECT-- PHP Fatal error: [snuffleupagus][config] Trailing chars '.not_a_valid_keyword("test");' at the end of '.enable().not_a_valid_keyword("test");' on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][config] Trailing chars '.not_a_valid_keyword("test");' at the end of '.enable().not_a_valid_keyword("test");' on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Trailing chars '.not_a_valid_keyword("test");' at the end of '.enable().not_a_valid_keyword("test");' on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_wrong_quotes.phpt b/src/tests/broken_conf_wrong_quotes.phpt index 35e38260..119bbe73 100644 --- a/src/tests/broken_conf_wrong_quotes.phpt +++ b/src/tests/broken_conf_wrong_quotes.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_wrong_quotes.ini --EXPECT-- PHP Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"\)': it doesn't look like a valid string on line 1 in Unknown on line 0 -Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"\)': it doesn't look like a valid string on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][error] There is an issue with the parsing of '"\)': it doesn't look like a valid string on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_conf_wrong_type.phpt b/src/tests/broken_conf_wrong_type.phpt index b7e0d28c..b90d6ff4 100644 --- a/src/tests/broken_conf_wrong_type.phpt +++ b/src/tests/broken_conf_wrong_type.phpt @@ -8,4 +8,7 @@ sp.configuration_file={PWD}/config/broken_conf_wrong_type.ini --EXPECTF-- PHP Fatal error: [snuffleupagus][error] .ret_type() is expecting a valid php type ('false', 'true', 'array'. 'object', 'long', 'double', 'null', 'resource', 'reference', 'undef') on line 5 in Unknown on line 0 -Fatal error: [snuffleupagus][error] .ret_type() is expecting a valid php type ('false', 'true', 'array'. 'object', 'long', 'double', 'null', 'resource', 'reference', 'undef') on line 5 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][error] .ret_type() is expecting a valid php type ('false', 'true', 'array'. 'object', 'long', 'double', 'null', 'resource', 'reference', 'undef') on line 5 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_regexp.phpt b/src/tests/broken_regexp.phpt index 85b9ef32..2fc130d7 100644 --- a/src/tests/broken_regexp.phpt +++ b/src/tests/broken_regexp.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] '.value_r()' is expecting a valid rege Fatal error: [snuffleupagus][config] Failed to compile '^$[': missing terminating ] for character class on line 1. in Unknown on line 0 -Fatal error: [snuffleupagus][config] '.value_r()' is expecting a valid regexp, and not '"^$["' on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] '.value_r()' is expecting a valid regexp, and not '"^$["' on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/broken_unmatching_brackets.phpt b/src/tests/broken_unmatching_brackets.phpt index 3825dcd6..33eaaa72 100644 --- a/src/tests/broken_unmatching_brackets.phpt +++ b/src/tests/broken_unmatching_brackets.phpt @@ -11,4 +11,7 @@ PHP Fatal error: [snuffleupagus][config] Invalid value 'arr[b]]]]]' for `param` Fatal error: [snuffleupagus][config] Invalid `]` position. in Unknown on line 0 -Fatal error: [snuffleupagus][config] Invalid value 'arr[b]]]]]' for `param` on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid value 'arr[b]]]]]' for `param` on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/disabled_function_ensure_client_valid_certs_curl_multi_setopt.phpt b/src/tests/disabled_function_ensure_client_valid_certs_curl_multi_setopt.phpt index fd4d1767..96968766 100644 --- a/src/tests/disabled_function_ensure_client_valid_certs_curl_multi_setopt.phpt +++ b/src/tests/disabled_function_ensure_client_valid_certs_curl_multi_setopt.phpt @@ -1,7 +1,5 @@ --TEST-- Disable functions - Ensure that client certificates validation can't be disabled via `curl_multi_setopt` ---EXTENSIONS-- -curl --SKIPIF-- --EXPECT-- -1 +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 + Fatal error: [snuffleupagus][config] You're trying to use the cookie encryption featureon line 2 without having set the `.cookie_env_var` option in`sp.global`: please set it first in Unknown on line 0 diff --git a/src/tests/encrypt_cookies_no_key.phpt b/src/tests/encrypt_cookies_no_key.phpt index ca815937..3eb726e0 100644 --- a/src/tests/encrypt_cookies_no_key.phpt +++ b/src/tests/encrypt_cookies_no_key.phpt @@ -16,5 +16,6 @@ EOF; --FILE-- --EXPECT-- -1 +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 + Fatal error: [snuffleupagus][config] You're trying to use the cookie encryption featureon line 2 without having set the `.encryption_key` option in`sp.global`: please set it first in Unknown on line 0 diff --git a/src/tests/encrypt_regexp_cookies_bad_regexp.phpt b/src/tests/encrypt_regexp_cookies_bad_regexp.phpt index b933aba1..8272148e 100644 --- a/src/tests/encrypt_regexp_cookies_bad_regexp.phpt +++ b/src/tests/encrypt_regexp_cookies_bad_regexp.phpt @@ -15,12 +15,7 @@ EOF; --FILE-- --EXPECT-- -array(2) { - ["super_cookie"]=> - string(92) "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP3gV9YJZL/pUeNAjCKFW0U2ywmf1CwHzwd2pWM=" - ["awful_cookie"]=> - string(18) "awful_cookie_value" -} +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 Fatal error: [snuffleupagus][config] Failed to compile '^super_co[a-z+$': missing terminating ] for character class on line 2. in Unknown on line 0 diff --git a/src/tests/encrypt_regexp_cookies_no_env.phpt b/src/tests/encrypt_regexp_cookies_no_env.phpt index 1238075a..0c0dea51 100644 --- a/src/tests/encrypt_regexp_cookies_no_env.phpt +++ b/src/tests/encrypt_regexp_cookies_no_env.phpt @@ -16,5 +16,6 @@ EOF; --FILE-- --EXPECT-- -1 +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 + Fatal error: [snuffleupagus][config] You're trying to use the cookie encryption featureon line 2 without having set the `.cookie_env_var` option in`sp.global`: please set it first in Unknown on line 0 diff --git a/src/tests/encrypt_regexp_cookies_no_key.phpt b/src/tests/encrypt_regexp_cookies_no_key.phpt index 5e6db7e0..1877dd6e 100644 --- a/src/tests/encrypt_regexp_cookies_no_key.phpt +++ b/src/tests/encrypt_regexp_cookies_no_key.phpt @@ -16,5 +16,6 @@ EOF; --FILE-- --EXPECT-- -1 +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 + Fatal error: [snuffleupagus][config] You're trying to use the cookie encryption featureon line 2 without having set the `.encryption_key` option in`sp.global`: please set it first in Unknown on line 0 diff --git a/src/tests/inexistent_conf_file.phpt b/src/tests/inexistent_conf_file.phpt index ebe2aaa0..a68ca9ea 100644 --- a/src/tests/inexistent_conf_file.phpt +++ b/src/tests/inexistent_conf_file.phpt @@ -9,4 +9,7 @@ sp.configuration_file={PWD}/config/unexistent_configuration_file.ini --EXPECTF-- PHP Fatal error: [snuffleupagus][config] Could not open configuration file %a/config/unexistent_configuration_file.ini : No such file or directory in Unknown on line 0 -Fatal error: [snuffleupagus][config] Could not open configuration file %a/config/unexistent_configuration_file.ini : No such file or directory in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Could not open configuration file %a/config/unexistent_configuration_file.ini : No such file or directory in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/inexistent_conf_file_list.phpt b/src/tests/inexistent_conf_file_list.phpt index 6b3026e8..3f91f387 100644 --- a/src/tests/inexistent_conf_file_list.phpt +++ b/src/tests/inexistent_conf_file_list.phpt @@ -9,4 +9,7 @@ sp.configuration_file={PWD}/../../config/default.rules,{PWD}/non_existent_config --EXPECTF-- PHP Fatal error: [snuffleupagus][config] Could not open configuration file %a/non_existent_configuration_file : No such file or directory in Unknown on line 0 -Fatal error: [snuffleupagus][config] Could not open configuration file %a/non_existent_configuration_file : No such file or directory in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Could not open configuration file %a/non_existent_configuration_file : No such file or directory in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. \ No newline at end of file diff --git a/src/tests/loading.phpt b/src/tests/loading.phpt index 25e2e170..db6395fe 100644 --- a/src/tests/loading.phpt +++ b/src/tests/loading.phpt @@ -7,4 +7,5 @@ Check for snuffleupagus presence echo "snuffleupagus extension is available"; ?> --EXPECT-- -snuffleupagus extension is available +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 +Could not startup. diff --git a/src/tests/sloppy_comparison_array_disabled.phpt b/src/tests/sloppy_comparison_array_disabled.phpt index b98c06b6..e8cd77b2 100644 --- a/src/tests/sloppy_comparison_array_disabled.phpt +++ b/src/tests/sloppy_comparison_array_disabled.phpt @@ -2,6 +2,8 @@ Sloppy comparison in_array disabled --SKIPIF-- +--INI-- +sp.allow_broken_configuration=On --FILE-- +--INI-- +sp.allow_broken_configuration=On --FILE-- +--INI-- +sp.allow_broken_configuration=On --FILE-- --INI-- +sp.allow_broken_configuration=On --FILE-- --EXPECTF-- -1 -Fatal error: [snuffleupagus][config] A rule can't be enabled and disabled on line 1 in Unknown on line 0 \ No newline at end of file +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 + +Fatal error: [snuffleupagus][config] A rule can't be enabled and disabled on line 1 in Unknown on line 0 diff --git a/src/tests/upload_validation_no_exec.phpt b/src/tests/upload_validation_no_exec.phpt index ca520172..a6cde108 100644 --- a/src/tests/upload_validation_no_exec.phpt +++ b/src/tests/upload_validation_no_exec.phpt @@ -14,20 +14,6 @@ Content-Disposition: form-data; name="test"; filename="test.php" var_dump($_FILES); ?> --EXPECTF-- -array(1) { - ["test"]=> - array(5) { - ["name"]=> - string(8) "test.php" - ["type"]=> - string(0) "" - ["tmp_name"]=> - string(0) "" - ["error"]=> - int(3) - ["size"]=> - int(0) - } -} +Fatal error: [snuffleupagus][config] Invalid configuration file in Unknown on line 0 Fatal error: [snuffleupagus][config] The `script` (tests/data/upload_no_exec.sh) isn't executable on line 1 in Unknown on line 0