]> granicus.if.org Git - php/commitdiff
little fix
authorStefan Esser <sesser@php.net>
Fri, 22 Nov 2002 19:34:17 +0000 (19:34 +0000)
committerStefan Esser <sesser@php.net>
Fri, 22 Nov 2002 19:34:17 +0000 (19:34 +0000)
main/rfc1867.c

index f422b7e66cff8bc0e7674a4ff5cb7258e53c76cf..38c8f1dd0b8013a99e1fbb1f84bc00a516bd7681 100644 (file)
@@ -72,7 +72,7 @@ void php_rfc1867_register_constants(TSRMLS_D)
 
 static void normalize_protected_variable(char *varname TSRMLS_DC)
 {
-       char *s=varname, *index=NULL, *indexend=NULL;
+       char *s=varname, *index=NULL, *indexend=NULL, *p;
        
        /* overjump leading space */
        while (*s == ' ') {
@@ -84,6 +84,15 @@ static void normalize_protected_variable(char *varname TSRMLS_DC)
                memcpy(varname, s, strlen(s)+1);
        }
 
+       for (p=varname; *p && *p != '['; p++) {
+               switch(*p) {
+                       case ' ':
+                       case '.':
+                               *p='_';
+                               break;
+               }
+       }
+
        /* find index */
        index = strchr(varname, '[');
        if (index) {