mirror of
https://github.com/php/php-src.git
synced 2024-11-28 20:34:29 +08:00
Fixed MOPB-26-2007 mb_parse_str() can be used to activate register_globals
# Discovered by Stefan Esser
This commit is contained in:
parent
8e67ec8225
commit
89939e13d6
@ -208,9 +208,8 @@ enum mbfl_no_encoding _php_mb_encoding_handler_ex(const php_mb_encoding_handler_
|
||||
/* register_globals stuff
|
||||
* XXX: this feature is going to be deprecated? */
|
||||
|
||||
if (info->force_register_globals) {
|
||||
prev_rg_state = PG(register_globals);
|
||||
PG(register_globals) = 1;
|
||||
if (info->force_register_globals && !(prev_rg_state = PG(register_globals))) {
|
||||
zend_alter_ini_entry("register_globals", sizeof("register_globals"), "1", sizeof("1")-1, PHP_INI_PERDIR, PHP_INI_STAGE_RUNTIME);
|
||||
}
|
||||
|
||||
if (!res || *res == '\0') {
|
||||
@ -343,8 +342,8 @@ enum mbfl_no_encoding _php_mb_encoding_handler_ex(const php_mb_encoding_handler_
|
||||
|
||||
out:
|
||||
/* register_global stuff */
|
||||
if (info->force_register_globals) {
|
||||
PG(register_globals) = prev_rg_state;
|
||||
if (info->force_register_globals && !prev_rg_state) {
|
||||
zend_alter_ini_entry("register_globals", sizeof("register_globals"), "0", sizeof("0")-1, PHP_INI_PERDIR, PHP_INI_STAGE_RUNTIME);
|
||||
}
|
||||
|
||||
if (convd != NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user