Skip to content

Commit 374646c

Browse files
committed
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3: updated the libmagic.patch Bug #61566 Fileinfo ext\fileinfo\tests\finfo_file_002.phpt fails Fix bug #61565 Fileinfo ext\fileinfo\tests\finfo_file_001.phpt fails - update to openssl 0.9.8u Conflicts: ext/fileinfo/tests/finfo_open_001.phpt ext/fileinfo/tests/finfo_open_error.phpt win32/build/libs_version.txt
2 parents 69e0e03 + 8684fb7 commit 374646c

File tree

8 files changed

+238
-101
lines changed

8 files changed

+238
-101
lines changed

ext/fileinfo/fileinfo.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,11 +510,22 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
510510
wrap = php_stream_locate_url_wrapper(buffer, &tmp2, 0 TSRMLS_CC);
511511

512512
if (wrap) {
513+
php_stream *stream;
513514
php_stream_context *context = php_stream_context_from_zval(zcontext, 0);
515+
516+
#ifdef PHP_WIN32
517+
if (php_stream_stat_path_ex(buffer, 0, &ssb, context) == SUCCESS) {
518+
if (ssb.sb.st_mode & S_IFDIR) {
519+
ret_val = mime_directory;
520+
goto common;
521+
}
522+
}
523+
#endif
524+
514525
#if PHP_API_VERSION < 20100412
515-
php_stream *stream = php_stream_open_wrapper_ex(buffer, "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
526+
stream = php_stream_open_wrapper_ex(buffer, "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
516527
#else
517-
php_stream *stream = php_stream_open_wrapper_ex(buffer, "rb", REPORT_ERRORS, NULL, context);
528+
stream = php_stream_open_wrapper_ex(buffer, "rb", REPORT_ERRORS, NULL, context);
518529
#endif
519530

520531
if (!stream) {

0 commit comments

Comments
 (0)