]> granicus.if.org Git - php/commitdiff
Use multibyte specific code for handling files and generic basename based
authorIlia Alshanetsky <iliaa@php.net>
Mon, 24 Jan 2005 22:35:23 +0000 (22:35 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 24 Jan 2005 22:35:23 +0000 (22:35 +0000)
code in all other instances.

main/rfc1867.c

index 4982cf3e59475b9f8d2612a9e17f3ac6234f27e8..e7748a089f4ed582102e1fe5cf879b31fde5c9aa 100644 (file)
@@ -32,6 +32,7 @@
 #include "php_globals.h"
 #include "php_variables.h"
 #include "rfc1867.h"
+#include "ext/standard/php_string.h"
 
 #define DEBUG_FILE_UPLOAD ZEND_DEBUG
 
@@ -1082,17 +1083,14 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
                                        s = tmp;
                                }
                                num_vars--;
-                       } else {
-                               s = strrchr(filename, '\\');
-                               if ((tmp = strrchr(filename, '/')) > s) {
-                                       s = tmp;
-                               }
-                       }
-#else
-                       s = strrchr(filename, '\\');
-                       if ((tmp = strrchr(filename, '/')) > s) {
-                               s = tmp;
+                               goto filedone;
                        }
+#endif                 
+                       php_basename(filename, strlen(filename), NULL, 0, &s, NULL TSRMLS_CC);
+                       efree(filename);
+                       filename = s;
+#if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING)
+filedone:                      
 #endif
                        
                        if (!is_anonymous) {