little fix

This commit is contained in:
Stefan Esser 2002-11-22 19:34:17 +00:00
parent e7d20a0422
commit 9dae1475ef

View 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) {