Patch preserve-external-variable-names-ini-option for Unknown/Other Function Bug #60219
Patch version 2012-01-24 00:11 UTC
Return to Bug #60219 |
Download this patch
Patch Revisions:
Developer: kenaniah@gmail.com
Index: php.ini-production
===================================================================
--- php.ini-production (revision 322635)
+++ php.ini-production (working copy)
@@ -363,6 +363,11 @@
; Default: ""
;zend.script_encoding =
+; Prevents PHP from converting dots "." and spaces " " to underscores "_" when parsing
+; external variable names
+; Default: Off
+;preserve_external_variable_names = Off
+
;;;;;;;;;;;;;;;;;
; Miscellaneous ;
;;;;;;;;;;;;;;;;;
Index: main/php_globals.h
===================================================================
--- main/php_globals.h (revision 322635)
+++ main/php_globals.h (working copy)
@@ -162,6 +162,8 @@
#ifdef PHP_WIN32
zend_bool windows_show_crt_warning;
#endif
+
+ zend_bool preserve_external_variable_names;
};
Index: main/php_variables.c
===================================================================
--- main/php_variables.c (revision 322635)
+++ main/php_variables.c (working copy)
@@ -90,10 +90,9 @@
var = var_orig = do_alloca(var_len + 1, use_heap);
memcpy(var_orig, var_name, var_len + 1);
- /* ensure that we don't have spaces or dots in the variable name (not binary safe) */
for (p = var; *p; p++) {
- if (*p == ' ' || *p == '.') {
- *p='_';
+ if (!PG(preserve_external_variable_names) && (*p == ' ' || *p == '.')) {
+ *p='_'; /* ensure that we don't have spaces or dots in the variable name (not binary safe) */
} else if (*p == '[') {
is_array = 1;
ip = p;
Index: main/main.c
===================================================================
--- main/main.c (revision 322635)
+++ main/main.c (working copy)
@@ -568,6 +568,7 @@
#ifdef PHP_WIN32
STD_PHP_INI_BOOLEAN("windows.show_crt_warning", "0", PHP_INI_ALL, OnUpdateBool, windows_show_crt_warning, php_core_globals, core_globals)
#endif
+ STD_PHP_INI_BOOLEAN("preserve_external_variable_names", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, preserve_external_variable_names, php_core_globals, core_globals)
PHP_INI_END()
/* }}} */
Index: php.ini-development
===================================================================
--- php.ini-development (revision 322635)
+++ php.ini-development (working copy)
@@ -363,6 +363,11 @@
; Default: ""
;zend.script_encoding =
+; Prevents PHP from converting dots "." and spaces " " to underscores "_" when parsing
+; external variable names
+; Default: Off
+;preserve_external_variable_names = Off
+
;;;;;;;;;;;;;;;;;
; Miscellaneous ;
;;;;;;;;;;;;;;;;;
|