cvs: php-src /main rfc1867.c
| From: | Andrei Zmievski | Date: | Tue, 27 Sep 2005 17:50:00 +0000 |
| Subject: | cvs: php-src /main rfc1867.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-34167@lists.php.net to get a copy of this message | ||
andrei Tue Sep 27 13:50:00 2005 EDT
Modified files:
/php-src/main rfc1867.c
Log:
Unicode fixes.
http://cvs.php.net/diff.php/php-src/main/rfc1867.c?r1=1.175&r2=1.176&ty=u
Index: php-src/main/rfc1867.c
diff -u php-src/main/rfc1867.c:1.175 php-src/main/rfc1867.c:1.176
--- php-src/main/rfc1867.c:1.175 Wed Aug 31 16:42:14 2005
+++ php-src/main/rfc1867.c Tue Sep 27 13:50:00 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: rfc1867.c,v 1.175 2005/08/31 20:42:14 andrei Exp $ */
+/* $Id: rfc1867.c,v 1.176 2005/09/27 17:50:00 andrei Exp $ */
/*
* This product includes software developed by the Apache Group
@@ -1227,22 +1227,24 @@
/* New Rule: never repair potential malicious user input */
if (!skip_upload) {
UChar32 c = 0;
- int32_t ic;
+ int32_t ic, l_ic;
long l = 0;
for (ic = 0; ic < param_len; ) {
+ l_ic = ic;
U16_NEXT(param, ic, param_len, c);
if (c == 0x5b /*'['*/) {
l++;
} else if (c == 0x5d /*']'*/) {
l--;
+ l_ic = ic;
U16_NEXT(param, ic, param_len, c);
if (ic < param_len && c != 0x5b /*'['*/) {
skip_upload = 1;
break;
} else {
- /* decrement index so that the same character is retrieved again */
- ic--;
+ /* go back so that the same character is retrieved again */
+ ic = l_ic;
}
}
if (l < 0) {
@@ -1281,12 +1283,12 @@
{
if (PG(upload_max_filesize) > 0 && total_bytes > PG(upload_max_filesize)) {
#if DEBUG_FILE_UPLOAD
- sapi_module.sapi_error(E_NOTICE, "upload_max_filesize of %ld bytes exceeded - file
[%s=%s] not saved", PG(upload_max_filesize), param, filename);
+ sapi_module.sapi_error(E_NOTICE, "upload_max_filesize of %ld bytes exceeded - file
[%r=%r] not saved", PG(upload_max_filesize), param, filename);
#endif
cancel_upload = UPLOAD_ERROR_A;
} else if (max_file_size && (total_bytes > max_file_size)) {
#if DEBUG_FILE_UPLOAD
- sapi_module.sapi_error(E_NOTICE, "MAX_FILE_SIZE of %ld bytes exceeded - file [%s=%s] not
saved", max_file_size, param, filename);
+ sapi_module.sapi_error(E_NOTICE, "MAX_FILE_SIZE of %ld bytes exceeded - file [%r=%r] not
saved", max_file_size, param, filename);
#endif
cancel_upload = UPLOAD_ERROR_B;
} else if (blen > 0) {
@@ -1313,7 +1315,7 @@
}
#if DEBUG_FILE_UPLOAD
if(u_strlen(filename) > 0 && total_bytes == 0 && !cancel_upload) {
- sapi_module.sapi_error(E_WARNING, "Uploaded file size 0 - file [%v=%v] not saved",
param, filename);
+ sapi_module.sapi_error(E_WARNING, "Uploaded file size 0 - file [%r=%r] not saved",
param, filename);
cancel_upload = 5;
}
#endif