]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #29369 (Uploaded files with ' or " in their names get their
authorIlia Alshanetsky <iliaa@php.net>
Sun, 25 Jul 2004 19:19:28 +0000 (19:19 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 25 Jul 2004 19:19:28 +0000 (19:19 +0000)
names truncated at those characters).

main/rfc1867.c

index c810688434ee5cdf355294b72f3ce9d25b31bfab..c373639a0fc2a598764f6f10b7e9c6845649ce53 100644 (file)
@@ -632,6 +632,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;
@@ -639,6 +640,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) {