Bug #71615 [Fbk->Ver]: Some file perform finfo_file will appear notice Array to string conversion

From: Date: Wed, 24 Feb 2016 13:04:22 +0000
Subject: Bug #71615 [Fbk->Ver]: Some file perform finfo_file will appear notice Array to string conversion
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199451@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71615&edit=1

 ID:                 71615
 Updated by:         cmb@php.net
 Reported by:        janpoem at gmail dot com
 Summary:            Some file perform finfo_file will appear notice
                     Array to string conversion
-Status:             Feedback
+Status:             Verified
 Type:               Bug
-Package:            Unknown/Other Function
+Package:            Filesystem function related
 Operating System:   Windows 10
 PHP Version:        7.0.3
-Assigned To:        cmb
+Assigned To:        
 Block user comment: N
 Private report:     N

 New Comment:

Thanks. Now I can reproduce the issue.


Previous Comments:
------------------------------------------------------------------------
[2016-02-24 07:20:22] janpoem at gmail dot com

I make a simple case. Please download the file as below.

http://git.oschina.net/kephp/kephp/raw/master/misc/issues/finfo_file_test.zip

In making these files, I found the this issue is triggered by the file content.

In the zip file, there is a file named "another.markdown" would throw out the notice, but
another file named "readme.md" was nothing happened.

It is really strange.

------------------------------------------------------------------------
[2016-02-23 12:40:23] cmb@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

Actually, I can't reproduce the behavior on Win 7 with a variation of the supplied test script.

------------------------------------------------------------------------
[2016-02-17 09:05:56] janpoem at gmail dot com

Description:
------------
Some files will appear Notice "Array to string conversion" when executing the function
"finfo_file". But the file is real and the path is absolute path. 



Test script:
---------------
<?php

$finfo = finfo_open(FILEINFO_MIME);

$files = [
	__FILE__, // ok
	'array_object.php', // ok
	'C:/Windows/system.ini', // ok
	'D:\\htdocs\\jquery\\README.md', // this will appear notice "Array to string
conversion"
];

foreach ($files as $file) {
	var_dump(finfo_file($finfo, $file));
}

finfo_close($finfo);



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=71615&edit=1


Thread (6 messages)

« previous php.bugs (#199451) next »