iliaa           Mon Feb 14 19:25:39 2005 EDT

  Modified files:              
    /php-src/main       rfc1867.c 
  Log:
  Prune uploaded file names to \ on all OSes, read comments for explanation.
  
  
http://cvs.php.net/diff.php/php-src/main/rfc1867.c?r1=1.169&r2=1.170&ty=u
Index: php-src/main/rfc1867.c
diff -u php-src/main/rfc1867.c:1.169 php-src/main/rfc1867.c:1.170
--- php-src/main/rfc1867.c:1.169        Mon Jan 31 21:33:07 2005
+++ php-src/main/rfc1867.c      Mon Feb 14 19:25:38 2005
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: rfc1867.c,v 1.169 2005/02/01 02:33:07 iliaa Exp $ */
+/* $Id: rfc1867.c,v 1.170 2005/02/15 00:25:38 iliaa Exp $ */
 
 /*
  *  This product includes software developed by the Apache Group
@@ -1077,11 +1077,7 @@
                                        str_len = strlen(filename);
                                        
php_mb_gpc_encoding_converter(&filename, &str_len, 1, NULL, NULL TSRMLS_CC);
                                }
-#ifdef PHP_WIN32
                                s = php_mb_strrchr(filename, '\\' TSRMLS_CC);
-#else
-                               s = filename;
-#endif
                                if ((tmp = php_mb_strrchr(filename, '/' 
TSRMLS_CC)) > s) {
                                        s = tmp;
                                }
@@ -1089,12 +1085,13 @@
                                goto filedone;
                        }
 #endif                 
-
-#ifdef PHP_WIN32
+                       /* The \ check should technically be needed for win32 
systems only where
+                        * it is a valid path separator. However, IE in all 
it's wisdom always sends
+                        * the full path of the file on the user's filesystem, 
which means that unless
+                        * the user does basename() they get a bogus file name. 
Until IE's user base drops 
+                        * to nill or problem is fixed this code must remain 
enabled for all systems.
+                        */
                        s = strrchr(filename, '\\');
-#else
-                       s = filename;
-#endif
                        if ((tmp = strrchr(filename, '/')) > s) {
                                s = tmp;
                        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to