Patch bug64325.patch for *General Issues Bug #64325
Patch version 2013-03-01 03:29 UTC
Return to Bug #64325 |
Download this patch
Patch Revisions:
Developer: laruence@php.net
diff --git a/main/php_variables.c b/main/php_variables.c
index cf2b623..843f8f5 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -152,10 +152,10 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars
if (isspace(*ip)) {
ip++;
}
- if (*ip==']') {
+ if (*ip == ']' && *(ip + 1) != ']') {
index_s = NULL;
} else {
- ip = strchr(ip, ']');
+ ip = strrchr(ip, ']');
if (!ip) {
/* PHP variables cannot contain '[' in their names, so we replace the character with a '_' */
*(index_s - 1) = '_';
|