summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--src/php_snuffleupagus.h1
-rw-r--r--src/snuffleupagus.c12
-rw-r--r--src/sp_config.h1
-rw-r--r--src/sp_config_keywords.c1
5 files changed, 1 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 1d92d2d..649c8b6 100644
--- a/Makefile
+++ b/Makefile
@@ -40,7 +40,7 @@ tests: release tests-incremental ## compile a release build and run the testsui
40 40
41tests-incremental: ## perform an incremental build and run the testsuite 41tests-incremental: ## perform an incremental build and run the testsuite
42 make -C $(SRC) 42 make -C $(SRC)
43 TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 SP_SKIP_OLD_PHP_CHECK=1 make -C $(SRC) test 43 TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 make -C $(SRC) test
44 44
45coverage: ## compile snuffleugpaus, and run the testsuite with coverage 45coverage: ## compile snuffleugpaus, and run the testsuite with coverage
46 cd $(SRC); phpize 46 cd $(SRC); phpize
diff --git a/src/php_snuffleupagus.h b/src/php_snuffleupagus.h
index 1f122e3..b738ae8 100644
--- a/src/php_snuffleupagus.h
+++ b/src/php_snuffleupagus.h
@@ -148,7 +148,6 @@ bool config_server_encode;
148bool config_server_strip; 148bool config_server_strip;
149zend_string *config_encryption_key; 149zend_string *config_encryption_key;
150zend_string *config_cookies_env_var; 150zend_string *config_cookies_env_var;
151bool config_show_old_php_warning;
152 151
153HashTable *config_disabled_functions; 152HashTable *config_disabled_functions;
154HashTable *config_disabled_functions_hooked; 153HashTable *config_disabled_functions_hooked;
diff --git a/src/snuffleupagus.c b/src/snuffleupagus.c
index 22aca04..6264d22 100644
--- a/src/snuffleupagus.c
+++ b/src/snuffleupagus.c
@@ -361,7 +361,6 @@ static void dump_config(void) {
361 add_assoc_long(&arr, SP_TOKEN_GLOBAL "." SP_TOKEN_MAX_EXECUTION_DEPTH, SPCFG(max_execution_depth)); 361 add_assoc_long(&arr, SP_TOKEN_GLOBAL "." SP_TOKEN_MAX_EXECUTION_DEPTH, SPCFG(max_execution_depth));
362 add_assoc_bool(&arr, SP_TOKEN_GLOBAL "." SP_TOKEN_SERVER_ENCODE, SPCFG(server_encode)); 362 add_assoc_bool(&arr, SP_TOKEN_GLOBAL "." SP_TOKEN_SERVER_ENCODE, SPCFG(server_encode));
363 add_assoc_bool(&arr, SP_TOKEN_GLOBAL "." SP_TOKEN_SERVER_STRIP, SPCFG(server_strip)); 363 add_assoc_bool(&arr, SP_TOKEN_GLOBAL "." SP_TOKEN_SERVER_STRIP, SPCFG(server_strip));
364 add_assoc_bool(&arr, SP_TOKEN_GLOBAL "." SP_TOKEN_SHOW_OLD_PHP_WARNING, SPCFG(show_old_php_warning));
365 364
366 add_assoc_bool(&arr, SP_TOKEN_AUTO_COOKIE_SECURE, SPCFG(auto_cookie_secure).enable); 365 add_assoc_bool(&arr, SP_TOKEN_AUTO_COOKIE_SECURE, SPCFG(auto_cookie_secure).enable);
367 add_assoc_bool(&arr, SP_TOKEN_XXE_PROTECTION, SPCFG(xxe_protection).enable); 366 add_assoc_bool(&arr, SP_TOKEN_XXE_PROTECTION, SPCFG(xxe_protection).enable);
@@ -501,7 +500,6 @@ static PHP_INI_MH(OnUpdateConfiguration) {
501 } 500 }
502 501
503 // set some defaults 502 // set some defaults
504 SPCFG(show_old_php_warning) = true;
505 SPCFG(readonly_exec).extended_checks = true; 503 SPCFG(readonly_exec).extended_checks = true;
506 504
507 char *str = new_value->val; 505 char *str = new_value->val;
@@ -606,16 +604,6 @@ static PHP_INI_MH(OnUpdateConfiguration) {
606 (SPCFG(disabled_functions) && zend_hash_num_elements(SPCFG(disabled_functions))) || 604 (SPCFG(disabled_functions) && zend_hash_num_elements(SPCFG(disabled_functions))) ||
607 (SPCFG(disabled_functions_ret) && zend_hash_num_elements(SPCFG(disabled_functions_ret))); 605 (SPCFG(disabled_functions_ret) && zend_hash_num_elements(SPCFG(disabled_functions_ret)));
608 606
609 if (SPCFG(show_old_php_warning) && getenv("SP_SKIP_OLD_PHP_CHECK") == NULL) {
610 const time_t ts = time(NULL);
611 if ((PHP_VERSION_ID < 80100) ||
612 (PHP_VERSION_ID < 80200 && ts >= (time_t)1732492800L) ||
613 (PHP_VERSION_ID < 80300 && ts >= (time_t)1765152000L) ||
614 (PHP_VERSION_ID < 80400 && ts >= (time_t)1795392000L)) {
615 sp_log_warn("End-of-Life Check", "Your PHP version '" PHP_VERSION "' is not officially maintained anymore, see https://www.php.net/supported-versions.php for details. " \
616 "Please upgrade as soon as possible.");
617 }
618 }
619 return SUCCESS; 607 return SUCCESS;
620} 608}
621 609
diff --git a/src/sp_config.h b/src/sp_config.h
index 407c9bd..fb25fdb 100644
--- a/src/sp_config.h
+++ b/src/sp_config.h
@@ -272,7 +272,6 @@ typedef struct {
272#define SP_TOKEN_SERVER_STRIP "server_strip" 272#define SP_TOKEN_SERVER_STRIP "server_strip"
273#define SP_TOKEN_SID_MIN_LENGTH "sid_min_length" 273#define SP_TOKEN_SID_MIN_LENGTH "sid_min_length"
274#define SP_TOKEN_SID_MAX_LENGTH "sid_max_length" 274#define SP_TOKEN_SID_MAX_LENGTH "sid_max_length"
275#define SP_TOKEN_SHOW_OLD_PHP_WARNING "show_old_php_warning"
276 275
277// upload_validator 276// upload_validator
278#define SP_TOKEN_UPLOAD_SCRIPT "script" 277#define SP_TOKEN_UPLOAD_SCRIPT "script"
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c
index ba9ee7c..796b44b 100644
--- a/src/sp_config_keywords.c
+++ b/src/sp_config_keywords.c
@@ -148,7 +148,6 @@ SP_PARSE_FN(parse_global) {
148 {parse_uint, SP_TOKEN_MAX_EXECUTION_DEPTH, &(SPCFG(max_execution_depth))}, 148 {parse_uint, SP_TOKEN_MAX_EXECUTION_DEPTH, &(SPCFG(max_execution_depth))},
149 {parse_enable, SP_TOKEN_SERVER_ENCODE, &(SPCFG(server_encode))}, 149 {parse_enable, SP_TOKEN_SERVER_ENCODE, &(SPCFG(server_encode))},
150 {parse_enable, SP_TOKEN_SERVER_STRIP, &(SPCFG(server_strip))}, 150 {parse_enable, SP_TOKEN_SERVER_STRIP, &(SPCFG(server_strip))},
151 {parse_enable, SP_TOKEN_SHOW_OLD_PHP_WARNING, &(SPCFG(show_old_php_warning))},
152 {0, 0, 0}}; 151 {0, 0, 0}};
153 152
154 SP_PROCESS_CONFIG_KEYWORDS_ERR(); 153 SP_PROCESS_CONFIG_KEYWORDS_ERR();