summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcrKontrol2018-08-02 14:41:20 +0200
committerThibault "bui" Koechlin2018-08-02 14:41:20 +0200
commit69b95a117957ceaab16f5dfb68a41500a7958ba9 (patch)
tree23568b0770d5e8667f94ca300a1e95be2bb62022 /src
parent210a90e7fe5e45b55031ce1a7d02539ea3185879 (diff)
fix #203 (#204)
sp.disable_function.function().filename doesn't take phar:///
Diffstat (limited to 'src')
-rw-r--r--src/sp_config_keywords.c16
-rw-r--r--src/tests/broken_conf_invalid_filename.phpt2
2 files changed, 11 insertions, 7 deletions
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c
index 8e1c2dc..fb20a43 100644
--- a/src/sp_config_keywords.c
+++ b/src/sp_config_keywords.c
@@ -278,7 +278,8 @@ int parse_cookie(char *line) {
278 return -1; 278 return -1;
279 } 279 }
280 } 280 }
281 SNUFFLEUPAGUS_G(config).config_cookie->cookies = 281 SNUFFLEUPAGUS_G(config)
282 .config_cookie->cookies =
282 sp_list_insert(SNUFFLEUPAGUS_G(config).config_cookie->cookies, cookie); 283 sp_list_insert(SNUFFLEUPAGUS_G(config).config_cookie->cookies, cookie);
283 return SUCCESS; 284 return SUCCESS;
284} 285}
@@ -392,11 +393,14 @@ int parse_disabled_functions(char *line) {
392 " must take a function name on line %zu.", 393 " must take a function name on line %zu.",
393 line, sp_line_no); 394 line, sp_line_no);
394 return -1; 395 return -1;
395 } else if (df->filename && *ZSTR_VAL(df->filename) != '/') { 396 } else if (df->filename && (*ZSTR_VAL(df->filename) != '/') &&
396 sp_log_err("config", 397 (0 !=
397 "Invalid configuration line: 'sp.disabled_functions%s':" 398 strncmp(ZSTR_VAL(df->filename), "phar://", strlen("phar://")))) {
398 "'.filename' must be an absolute path on line %zu.", 399 sp_log_err(
399 line, sp_line_no); 400 "config",
401 "Invalid configuration line: 'sp.disabled_functions%s':"
402 "'.filename' must be an absolute path or a phar archive on line %zu.",
403 line, sp_line_no);
400 return -1; 404 return -1;
401 } else if (!(allow ^ drop)) { 405 } else if (!(allow ^ drop)) {
402 sp_log_err("config", 406 sp_log_err("config",
diff --git a/src/tests/broken_conf_invalid_filename.phpt b/src/tests/broken_conf_invalid_filename.phpt
index 61b967b..a1515a7 100644
--- a/src/tests/broken_conf_invalid_filename.phpt
+++ b/src/tests/broken_conf_invalid_filename.phpt
@@ -6,4 +6,4 @@ Broken configuration filename without absolute path
6sp.configuration_file={PWD}/config/broken_conf_invalid_filename.ini 6sp.configuration_file={PWD}/config/broken_conf_invalid_filename.ini
7--FILE-- 7--FILE--
8--EXPECTF-- 8--EXPECTF--
9[snuffleupagus][0.0.0.0][config][error] Invalid configuration line: 'sp.disabled_functions.function("sprintf").filename("wrong file name").drop();':'.filename' must be an absolute path on line 1. 9[snuffleupagus][0.0.0.0][config][error] 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.