summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2005-01-24 22:35:23 (GMT)
committerIlia Alshanetsky <iliaa@php.net>2005-01-24 22:35:23 (GMT)
commit71695f815910d6c22202e674f7296466e61252b2 (patch)
tree95045407f7ac6fa73855ea99f0e65568e00cfdfc /main
parentb570ad759b3d606befdb5e2f2f80072aeec23bb7 (diff)
downloadphp-71695f815910d6c22202e674f7296466e61252b2.tar.gz
Use multibyte specific code for handling files and generic basename based
code in all other instances.
Diffstat (limited to 'main')
-rw-r--r--main/rfc1867.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/main/rfc1867.c b/main/rfc1867.c
index 4982cf3..e7748a0 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -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) {