summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoliy Belsky <ab@php.net>2012-04-02 17:19:09 +0200
committerStanislav Malyshev <stas@php.net>2012-04-11 20:23:45 -0700
commit61747bd041513f4e7c04fdc4890fbd1a6e76b907 (patch)
tree48f66a0ac7b428c456c02b1a3af16d4cf598fb5b
parentdcdd6dab56c58c5798ee36269724e29c6bb562b8 (diff)
downloadphp-git-61747bd041513f4e7c04fdc4890fbd1a6e76b907.tar.gz
Fix bug #61565 Fileinfo ext\fileinfo\tests\finfo_file_001.phpt fails
-rw-r--r--ext/fileinfo/fileinfo.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c
index 29f9bebbc8..757ba04ac1 100644
--- a/ext/fileinfo/fileinfo.c
+++ b/ext/fileinfo/fileinfo.c
@@ -510,11 +510,22 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
wrap = php_stream_locate_url_wrapper(buffer, &tmp2, 0 TSRMLS_CC);
if (wrap) {
+ php_stream *stream;
php_stream_context *context = php_stream_context_from_zval(zcontext, 0);
+
+#ifdef PHP_WIN32
+ if (php_stream_stat_path_ex(buffer, 0, &ssb, context) == SUCCESS) {
+ if (ssb.sb.st_mode & S_IFDIR) {
+ ret_val = mime_directory;
+ goto common;
+ }
+ }
+#endif
+
#if PHP_API_VERSION < 20100412
- php_stream *stream = php_stream_open_wrapper_ex(buffer, "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
+ stream = php_stream_open_wrapper_ex(buffer, "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
#else
- php_stream *stream = php_stream_open_wrapper_ex(buffer, "rb", REPORT_ERRORS, NULL, context);
+ stream = php_stream_open_wrapper_ex(buffer, "rb", REPORT_ERRORS, NULL, context);
#endif
if (!stream) {