summaryrefslogtreecommitdiff
path: root/src/sp_ini.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp_ini.c')
-rw-r--r--src/sp_ini.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/sp_ini.c b/src/sp_ini.c
index 7fec297..ed23fb7 100644
--- a/src/sp_ini.c
+++ b/src/sp_ini.c
@@ -12,12 +12,12 @@
12 } 12 }
13 13
14 14
15static bool /* success */ sp_ini_check(zend_string *varname, zend_string *new_value, sp_ini_entry **sp_entry_p) { 15static bool /* success */ sp_ini_check(zend_string *const restrict varname, zend_string const *const restrict new_value, sp_ini_entry **sp_entry_p) {
16 if (!varname || ZSTR_LEN(varname) == 0) { 16 if (!varname || ZSTR_LEN(varname) == 0) {
17 return false; 17 return false;
18 } 18 }
19 19
20 sp_config_ini *cfg = &(SPCFG(ini)); 20 sp_config_ini const* const cfg = &(SPCFG(ini));
21 sp_ini_entry *entry = zend_hash_find_ptr(cfg->entries, varname); 21 sp_ini_entry *entry = zend_hash_find_ptr(cfg->entries, varname);
22 if (sp_entry_p) { 22 if (sp_entry_p) {
23 *sp_entry_p = entry; 23 *sp_entry_p = entry;
@@ -76,10 +76,9 @@ static bool /* success */ sp_ini_check(zend_string *varname, zend_string *new_va
76} 76}
77 77
78static PHP_INI_MH(sp_ini_onmodify) { 78static PHP_INI_MH(sp_ini_onmodify) {
79 zend_ini_entry *ini_entry = entry;
80 sp_ini_entry *sp_entry = NULL; 79 sp_ini_entry *sp_entry = NULL;
81 80
82 if (!sp_ini_check(ini_entry->name, new_value, &sp_entry)) { 81 if (!sp_ini_check(entry->name, new_value, &sp_entry)) {
83 return FAILURE; 82 return FAILURE;
84 } 83 }
85 84
@@ -91,7 +90,7 @@ static PHP_INI_MH(sp_ini_onmodify) {
91} 90}
92 91
93void sp_hook_ini() { 92void sp_hook_ini() {
94 sp_config_ini *cfg = &(SPCFG(ini)); 93 sp_config_ini const* const cfg = &(SPCFG(ini));
95 sp_ini_entry *sp_entry; 94 sp_ini_entry *sp_entry;
96 zend_ini_entry *ini_entry; 95 zend_ini_entry *ini_entry;
97 ZEND_HASH_FOREACH_PTR(cfg->entries, sp_entry) 96 ZEND_HASH_FOREACH_PTR(cfg->entries, sp_entry)
@@ -126,8 +125,8 @@ void sp_hook_ini() {
126 125
127void sp_unhook_ini() { 126void sp_unhook_ini() {
128 sp_ini_entry *sp_entry; 127 sp_ini_entry *sp_entry;
129 zend_ini_entry *ini_entry;
130 ZEND_HASH_FOREACH_PTR(SPCFG(ini).entries, sp_entry) 128 ZEND_HASH_FOREACH_PTR(SPCFG(ini).entries, sp_entry)
129 zend_ini_entry *ini_entry;
131 if (!sp_entry->orig_onmodify) { 130 if (!sp_entry->orig_onmodify) {
132 // not hooked or no original onmodify 131 // not hooked or no original onmodify
133 continue; 132 continue;