From c016fa1a7ce11e657f215dd69deac59d973d6dd9 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 10 Dec 2022 11:36:04 +0100 Subject: Even more changes to accomodate PHP8.2 --- src/sp_ini.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/sp_ini.c') diff --git a/src/sp_ini.c b/src/sp_ini.c index ed23fb7..7b22012 100644 --- a/src/sp_ini.c +++ b/src/sp_ini.c @@ -57,9 +57,15 @@ static bool /* success */ sp_ini_check(zend_string *const restrict varname, zend // we have a new_value. if (entry->min || entry->max) { +#if PHP_VERSION_ID >= 80200 + zend_long lvalue = ZEND_STRTOL(ZSTR_VAL(new_value), NULL, 0); + if ((entry->min && ZEND_STRTOL(ZSTR_VAL(entry->min), NULL, 0) > lvalue) || + (entry->max && ZEND_STRTOL(ZSTR_VAL(entry->max), NULL, 0) < lvalue)) { +#else zend_long lvalue = zend_atol(ZSTR_VAL(new_value), ZSTR_LEN(new_value)); if ((entry->min && zend_atol(ZSTR_VAL(entry->min), ZSTR_LEN(entry->min)) > lvalue) || (entry->max && zend_atol(ZSTR_VAL(entry->max), ZSTR_LEN(entry->max)) < lvalue)) { +#endif sp_log_ini_check_violation("%s", (entry->msg ? ZSTR_VAL(entry->msg) : "INI value out of range")); return simulation; } -- cgit v1.3