php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71615 Some file perform finfo_file will appear notice Array to string conversion
Submitted: 2016-02-17 09:05 UTC Modified: 2016-03-06 04:22 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:-1 (-50.0%)
From: janpoem at gmail dot com Assigned:
Status: No Feedback Package: Filesystem function related
PHP Version: 7.0.3 OS: Windows 10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: janpoem at gmail dot com
New email:
PHP Version: OS:

 

 [2016-02-17 09:05 UTC] 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);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-02-23 12:40 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2016-02-23 12:40 UTC] 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-24 07:20 UTC] 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-24 13:04 UTC] cmb@php.net
-Status: Feedback +Status: Verified -Package: Unknown/Other Function +Package: Filesystem function related -Assigned To: cmb +Assigned To:
 [2016-02-24 13:04 UTC] cmb@php.net
Thanks. Now I can reproduce the issue.
 [2016-02-25 08:53 UTC] laruence@php.net
-Status: Verified +Status: Feedback
 [2016-02-25 08:53 UTC] laruence@php.net
please try with 7.0.4, as I fixed a similar bug #71434 before
 [2016-03-06 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 20:01:45 2024 UTC