Skip to content

Commit 7ebbe20

Browse files
author
Andi Gutmans
committed
- Should fix short_tags and co. problem.
1 parent 2807ba1 commit 7ebbe20

File tree

3 files changed

+33
-14
lines changed

3 files changed

+33
-14
lines changed

main/main.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ static PHP_INI_MH(OnUpdateErrorReporting)
171171
# define DEFAULT_SENDMAIL_PATH NULL
172172
#endif
173173
PHP_INI_BEGIN()
174-
STD_PHP_INI_BOOLEAN("short_open_tag", "1", PHP_INI_ALL, OnUpdateInt, short_tags, php_core_globals, core_globals)
175-
STD_PHP_INI_BOOLEAN("asp_tags", "0", PHP_INI_ALL, OnUpdateInt, asp_tags, php_core_globals, core_globals)
174+
STD_PHP_INI_BOOLEAN("short_open_tag", "1", PHP_INI_ALL, OnUpdateBool, short_tags, php_core_globals, core_globals)
175+
STD_PHP_INI_BOOLEAN("asp_tags", "0", PHP_INI_ALL, OnUpdateBool, asp_tags, php_core_globals, core_globals)
176176
PHP_INI_ENTRY("precision", "14", PHP_INI_ALL, OnSetPrecision)
177-
STD_PHP_INI_BOOLEAN("output_buffering", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateInt, output_buffering, php_core_globals, core_globals)
177+
STD_PHP_INI_BOOLEAN("output_buffering", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, output_buffering, php_core_globals, core_globals)
178178

179179
PHP_INI_ENTRY_EX("highlight.comment", HL_COMMENT_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
180180
PHP_INI_ENTRY_EX("highlight.default", HL_DEFAULT_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
@@ -183,31 +183,31 @@ PHP_INI_BEGIN()
183183
PHP_INI_ENTRY_EX("highlight.bg", HL_BG_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
184184
PHP_INI_ENTRY_EX("highlight.keyword", HL_KEYWORD_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
185185

186-
STD_PHP_INI_BOOLEAN("magic_quotes_gpc", "1", PHP_INI_ALL, OnUpdateInt, magic_quotes_gpc, php_core_globals, core_globals)
187-
STD_PHP_INI_BOOLEAN("magic_quotes_runtime", "0", PHP_INI_ALL, OnUpdateInt, magic_quotes_runtime, php_core_globals, core_globals)
188-
STD_PHP_INI_BOOLEAN("magic_quotes_sybase", "0", PHP_INI_ALL, OnUpdateInt, magic_quotes_sybase, php_core_globals, core_globals)
186+
STD_PHP_INI_BOOLEAN("magic_quotes_gpc", "1", PHP_INI_ALL, OnUpdateBool, magic_quotes_gpc, php_core_globals, core_globals)
187+
STD_PHP_INI_BOOLEAN("magic_quotes_runtime", "0", PHP_INI_ALL, OnUpdateBool, magic_quotes_runtime, php_core_globals, core_globals)
188+
STD_PHP_INI_BOOLEAN("magic_quotes_sybase", "0", PHP_INI_ALL, OnUpdateBool, magic_quotes_sybase, php_core_globals, core_globals)
189189

190-
STD_PHP_INI_BOOLEAN("safe_mode", "0", PHP_INI_SYSTEM, OnUpdateInt, safe_mode, php_core_globals, core_globals)
191-
STD_PHP_INI_BOOLEAN("sql.safe_mode", "0", PHP_INI_SYSTEM, OnUpdateInt, sql_safe_mode, php_core_globals, core_globals)
190+
STD_PHP_INI_BOOLEAN("safe_mode", "0", PHP_INI_SYSTEM, OnUpdateBool, safe_mode, php_core_globals, core_globals)
191+
STD_PHP_INI_BOOLEAN("sql.safe_mode", "0", PHP_INI_SYSTEM, OnUpdateBool, sql_safe_mode, php_core_globals, core_globals)
192192
STD_PHP_INI_ENTRY("safe_mode_exec_dir", "1", PHP_INI_SYSTEM, OnUpdateString, safe_mode_exec_dir, php_core_globals, core_globals)
193-
STD_PHP_INI_BOOLEAN("enable_dl", "1", PHP_INI_SYSTEM, OnUpdateInt, enable_dl, php_core_globals, core_globals)
193+
STD_PHP_INI_BOOLEAN("enable_dl", "1", PHP_INI_SYSTEM, OnUpdateBool, enable_dl, php_core_globals, core_globals)
194194
PHP_INI_ENTRY_EX("allow_builtin_links", "0", PHP_INI_ALL, NULL, php_ini_boolean_displayer_cb)
195195

196196
PHP_INI_ENTRY("SMTP", "localhost", PHP_INI_ALL, NULL)
197197
PHP_INI_ENTRY("sendmail_path", DEFAULT_SENDMAIL_PATH, PHP_INI_SYSTEM, NULL)
198198
PHP_INI_ENTRY("sendmail_from", NULL, PHP_INI_ALL, NULL)
199199

200200
PHP_INI_ENTRY("error_reporting", NULL, PHP_INI_ALL, OnUpdateErrorReporting)
201-
STD_PHP_INI_BOOLEAN("display_errors", "1", PHP_INI_ALL, OnUpdateInt, display_errors, php_core_globals, core_globals)
202-
STD_PHP_INI_BOOLEAN("track_errors", "0", PHP_INI_ALL, OnUpdateInt, track_errors, php_core_globals, core_globals)
203-
STD_PHP_INI_BOOLEAN("log_errors", "0", PHP_INI_ALL, OnUpdateInt, log_errors, php_core_globals, core_globals)
201+
STD_PHP_INI_BOOLEAN("display_errors", "1", PHP_INI_ALL, OnUpdateBool, display_errors, php_core_globals, core_globals)
202+
STD_PHP_INI_BOOLEAN("track_errors", "0", PHP_INI_ALL, OnUpdateBool, track_errors, php_core_globals, core_globals)
203+
STD_PHP_INI_BOOLEAN("log_errors", "0", PHP_INI_ALL, OnUpdateBool, log_errors, php_core_globals, core_globals)
204204
STD_PHP_INI_ENTRY("error_log", NULL, PHP_INI_ALL, OnUpdateString, error_log, php_core_globals, core_globals)
205205

206206

207207
STD_PHP_INI_ENTRY("auto_prepend_file", NULL, PHP_INI_ALL, OnUpdateString, auto_prepend_file, php_core_globals, core_globals)
208208
STD_PHP_INI_ENTRY("auto_append_file", NULL, PHP_INI_ALL, OnUpdateString, auto_append_file, php_core_globals, core_globals)
209209

210-
STD_PHP_INI_BOOLEAN("y2k_compliance", "0", PHP_INI_ALL, OnUpdateInt, y2k_compliance, php_core_globals, core_globals)
210+
STD_PHP_INI_BOOLEAN("y2k_compliance", "0", PHP_INI_ALL, OnUpdateBool, y2k_compliance, php_core_globals, core_globals)
211211

212212
STD_PHP_INI_ENTRY("doc_root", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, doc_root, php_core_globals, core_globals)
213213
STD_PHP_INI_ENTRY("user_dir", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, user_dir, php_core_globals, core_globals)
@@ -225,7 +225,7 @@ PHP_INI_BEGIN()
225225
PHP_INI_ENTRY("max_execution_time", "30", PHP_INI_ALL, OnChangeMaxExecutionTime)
226226
PHP_INI_ENTRY("memory_limit", "8388608", PHP_INI_ALL, OnChangeMemoryLimit)
227227

228-
STD_PHP_INI_BOOLEAN("track_vars", (PHP_TRACK_VARS?"1":"0"), PHP_INI_ALL, OnUpdateInt, track_vars, php_core_globals, core_globals)
228+
STD_PHP_INI_BOOLEAN("track_vars", (PHP_TRACK_VARS?"1":"0"), PHP_INI_ALL, OnUpdateBool, track_vars, php_core_globals, core_globals)
229229
STD_PHP_INI_ENTRY("gpc_order", "GPC", PHP_INI_ALL, OnUpdateStringUnempty, gpc_order, php_core_globals, core_globals)
230230
STD_PHP_INI_ENTRY("arg_separator", "&", PHP_INI_ALL, OnUpdateStringUnempty, arg_separator, php_core_globals, core_globals)
231231
STD_PHP_INI_BOOLEAN("ignore_user_abort", "1", PHP_INI_ALL, OnUpdateInt, ignore_user_abort, php_core_globals, core_globals)

main/php_ini.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,24 @@ PHPAPI void display_ini_entries(zend_module_entry *module)
366366

367367
/* Standard message handlers */
368368

369+
PHPAPI PHP_INI_MH(OnUpdateBool)
370+
{
371+
zend_bool *p;
372+
#ifndef ZTS
373+
char *base = (char *) mh_arg2;
374+
#else
375+
char *base;
376+
377+
base = (char *) ts_resource(*((int *) mh_arg2));
378+
#endif
379+
380+
p = (zend_bool *) (base+(size_t) mh_arg1);
381+
382+
*p = (zend_bool) atoi(new_value);
383+
return SUCCESS;
384+
}
385+
386+
369387
PHPAPI PHP_INI_MH(OnUpdateInt)
370388
{
371389
long *p;

main/php_ini.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ pval *cfg_get_entry(char *name, uint name_length);
135135

136136

137137
/* Standard message handlers */
138+
PHPAPI PHP_INI_MH(OnUpdateBool);
138139
PHPAPI PHP_INI_MH(OnUpdateInt);
139140
PHPAPI PHP_INI_MH(OnUpdateReal);
140141
PHPAPI PHP_INI_MH(OnUpdateString);

0 commit comments

Comments
 (0)