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

index 58bf2f5583cab2a4be046a80eac8e081e14e1c2d..71a9998c70cd569896a3d514394e80ed864ba90a 100644 (file)
@@ -129,7 +129,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;
                                }