From: Ilia Alshanetsky Date: Sun, 25 Jul 2004 19:19:32 +0000 (+0000) Subject: MFH: Fixed bug #29369 (Uploaded files with ' or " in their names get their X-Git-Tag: php-4.3.9RC1~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9cb224eafebbd3ec313b294c689500a0c282f42f;p=php MFH: Fixed bug #29369 (Uploaded files with ' or " in their names get their names truncated at those characters). --- diff --git a/NEWS b/NEWS index 0bd9db2e43..170c2d5ad7 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ PHP 4 NEWS - Updated PCRE to provide better error handling in certain cases. (Andrei) - NSAPI: added "bucket" parameter to list of non-php.ini-keys of php4_execute for doing performance stats without warnings in server-log. (Uwe Schindler) +- Fixed bug #29369 (Uploaded files with ' or " in their names get their names + truncated at those characters). (Ilia) - Fixed bug #29333 (output_buffering+trans_sess_id can corrupt output). (Ilia) - Fixed bug #29226 (ctype_* functions missing validation of numeric string representations). (Ilia) diff --git a/main/rfc1867.c b/main/rfc1867.c index c37a711ce0..35abcb52b8 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -628,6 +628,7 @@ static char *php_ap_getword_conf(char **line TSRMLS_DC) if ((quote = *str) == '"' || quote == '\'') { strend = str + 1; +look_for_quote: while (*strend && *strend != quote) { if (*strend == '\\' && strend[1] && strend[1] == quote) { strend += 2; @@ -635,6 +636,14 @@ static char *php_ap_getword_conf(char **line TSRMLS_DC) ++strend; } } + if (*strend && *strend == quote) { + char p = *(strend + 1); + if (p != '\r' && p != '\n' && p != '\0') { + strend++; + goto look_for_quote; + } + } + res = substring_conf(str + 1, strend - str - 1, quote TSRMLS_CC); if (*strend == quote) {