com php-src: Fix bug #61565 Fileinfo ext\fileinfo\tests\f info_file_001.phpt fails: ext/fileinfo/filein fo.c
| From: | Anatoliy Belsky | Date: | Mon, 02 Apr 2012 15:19:09 +0000 |
| Subject: | com php-src: Fix bug #61565 Fileinfo ext\fileinfo\tests\f info_file_001.phpt fails: ext/fileinfo/filein fo.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-68638@lists.php.net to get a copy of this message | ||
Commit: 0cdba53aae783fd63f0aa525bc92e73d9e4c0aab
Author: Anatoliy Belsky <ab@php.net> Mon, 2 Apr 2012 17:19:09 +0200
Parents: 55a6f3a12d069cc69f02a31dd45b99c6ac2e43c6
Branches: PHP-5.3 PHP-5.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0cdba53aae783fd63f0aa525bc92e73d9e4c0aab
Log:
Fix bug #61565 Fileinfo ext\fileinfo\tests\finfo_file_001.phpt fails
Bugs:
https://bugs.php.net/61565
Changed paths:
M ext/fileinfo/fileinfo.c
Diff:
diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c
index caab03b..2c0e39a 100644
--- a/ext/fileinfo/fileinfo.c
+++ b/ext/fileinfo/fileinfo.c
@@ -515,11 +515,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) {