Bug #14898 Updated: $HTTP_POST_FILES['uploadedfile']['name'] error

From: Date: Wed, 09 Jan 2002 08:42:35 +0000
Subject: Bug #14898 Updated: $HTTP_POST_FILES['uploadedfile']['name'] error
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-76328@lists.php.net to get a copy of this message
ID: 14898 Comment by: a1593@ma.ks.edu.tw Reported By: a1593@ma.ks.edu.tw Status: Open Bug Type: HTTP related Operating System: linux slackware8 PHP Version: 4.1.1 New Comment: -----------code modified---------------------- //s = strrchr(filenamebuf, '\\'); char *tmps; s=filenamebuf; // set initial value for (tmps=filenamebuf;*tmps;tmps++) { if (*tmps<0){// *tmps>127, looks like 2 bytes of chinese code if (!*(tmps+1)) tmps++; continue; } if (*tmps=='\\') s=tmps; } ----------code modified end ------------------- Previous Comments: ------------------------------------------------------------------------ [2002-01-08 09:37:12] a1593@ma.ks.edu.tw the following code works well for chinese double-byte checking. -----------code modified---------------------- //s = strrchr(filenamebuf, '\\'); char *tmps; for (tmps=filenamebuf;*tmps;tmps++) { if (*tmps<0){// *tmps>127, looks like 2 bytes of chinese code if (!*(tmps+1)) tmps++; contonue; } if (*tmps=='\\') s=tmps; } ----------code modified end ------------------- ------------------------------------------------------------------------ [2002-01-07 22:48:48] a1593@ma.ks.edu.tw the fix is too rough and can't handle all chinese words, it need more efforts to check. i will do it in a few days. ------------------------------------------------------------------------ [2002-01-07 01:56:48] a1593@ma.ks.edu.tw /* This is a bug fix for rfc1867.c try to upload file from win2k with name C:\DISK0\»\³\.txt the original code get name as '.ext' which should be '»\³\.txt'. the following modify is necessary to for client using charset=BIG5. thanks PHP. lai a1593@ma.ks.edu.tw */ -----------code modified---------------------- //s = strrchr(filenamebuf, '\\'); for (s=filenamebuf+strlen(filenamebuf)-1;s>filenamebuf;s--) { if (*s=='\\' && *(s-1)>0) break; } ----------code modified end ------------------- ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=14898&edit=1

« previous php.dev (#76328) next »