summaryrefslogtreecommitdiff
path: root/src/snuffleupagus.c
diff options
context:
space:
mode:
authorjvoisin2025-05-13 16:24:50 +0200
committerjvoisin2025-05-13 16:24:50 +0200
commit847afcae9b6a0570dca96e23d8adf94831a09b4c (patch)
tree9f23746840bcb76cdb3b75502a7c83b15b3c86a3 /src/snuffleupagus.c
parentf31381db897989b8341cf4936b7bff829981d837 (diff)
Remove the useless show_old_php_warning feature
People are usually well-aware of the outdatedness of the PHP version they're running, which is likely why they're running Snuffleupagus in the first place. This feature shouldn't have been enabled by default, and I fail to see any case where anyone would want to enable it. Moreover, it doesn't take LTS versions from vendors/distributions into account, thus breaking on RHEL/Debian (old)stable.
Diffstat (limited to 'src/snuffleupagus.c')
-rw-r--r--src/snuffleupagus.c12
1 files changed, 0 insertions, 12 deletions
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