]> granicus.if.org Git - php/commitdiff
Stop at the index on an unmatched [
authorRasmus Lerdorf <rasmus@php.net>
Thu, 9 Sep 2004 16:21:49 +0000 (16:21 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Thu, 9 Sep 2004 16:21:49 +0000 (16:21 +0000)
main/php_variables.c

index 498d4b173d8127fb773780e277a9ddfd7a6c2903..5edfcd9206617e2dd794c641c7275ac2efba4ff8 100644 (file)
@@ -133,7 +133,7 @@ PHPAPI void php_register_variable_ex(char *var, zval *val, pval *track_vars_arra
                                if (!ip) {
                                        /* PHP variables cannot contain '[' in their names, so we replace the character with a '_' */
                                        *(index_s - 1) = '_';
-                                       index_len = var_len = strlen(var);
+                                       index_len = var_len = strlen(index);
                                        goto plain_var;
                                        return;
                                }