diff options
| author | jvoisin | 2022-12-10 11:36:04 +0100 |
|---|---|---|
| committer | jvoisin | 2022-12-10 11:43:07 +0100 |
| commit | c016fa1a7ce11e657f215dd69deac59d973d6dd9 (patch) | |
| tree | 5beeff849ea3bf85615e725fffc0f72344afa3be /src/sp_ini.c | |
| parent | 110daa81c3b11ec102daf4ee634e2f3d2e9c5f36 (diff) | |
Even more changes to accomodate PHP8.2
Diffstat (limited to 'src/sp_ini.c')
| -rw-r--r-- | src/sp_ini.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 | |||
| 57 | // we have a new_value. | 57 | // we have a new_value. |
| 58 | 58 | ||
| 59 | if (entry->min || entry->max) { | 59 | if (entry->min || entry->max) { |
| 60 | #if PHP_VERSION_ID >= 80200 | ||
| 61 | zend_long lvalue = ZEND_STRTOL(ZSTR_VAL(new_value), NULL, 0); | ||
| 62 | if ((entry->min && ZEND_STRTOL(ZSTR_VAL(entry->min), NULL, 0) > lvalue) || | ||
| 63 | (entry->max && ZEND_STRTOL(ZSTR_VAL(entry->max), NULL, 0) < lvalue)) { | ||
| 64 | #else | ||
| 60 | zend_long lvalue = zend_atol(ZSTR_VAL(new_value), ZSTR_LEN(new_value)); | 65 | zend_long lvalue = zend_atol(ZSTR_VAL(new_value), ZSTR_LEN(new_value)); |
| 61 | if ((entry->min && zend_atol(ZSTR_VAL(entry->min), ZSTR_LEN(entry->min)) > lvalue) || | 66 | if ((entry->min && zend_atol(ZSTR_VAL(entry->min), ZSTR_LEN(entry->min)) > lvalue) || |
| 62 | (entry->max && zend_atol(ZSTR_VAL(entry->max), ZSTR_LEN(entry->max)) < lvalue)) { | 67 | (entry->max && zend_atol(ZSTR_VAL(entry->max), ZSTR_LEN(entry->max)) < lvalue)) { |
| 68 | #endif | ||
| 63 | sp_log_ini_check_violation("%s", (entry->msg ? ZSTR_VAL(entry->msg) : "INI value out of range")); | 69 | sp_log_ini_check_violation("%s", (entry->msg ? ZSTR_VAL(entry->msg) : "INI value out of range")); |
| 64 | return simulation; | 70 | return simulation; |
| 65 | } | 71 | } |
