Bug #71434 [Opn->Ana]: finfo throws notice for specific python file
| From: | laruence@php.net | Date: | Sun, 24 Jan 2016 16:26:10 +0000 |
| Subject: | Bug #71434 [Opn->Ana]: finfo throws notice for specific python file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-198859@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71434&edit=1
ID: 71434
Updated by: laruence@php.net
Reported by: bluewind at xinu dot at
Summary: finfo throws notice for specific python file
-Status: Open
+Status: Analyzed
Type: Bug
Package: Filesystem function related
Operating System: Arch Linux
PHP Version: 7.0.2
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2016-01-24 16:17:46] laruence@php.net
This seems a little weird , the origin problem is in 5.6 branch: https://github.com/php/php-src/commit/46906925#diff-56e765972d18c84894ea061cfe58076aR1757
if (zend_hash_has_more_elements_ex(ht, &outer_pos) == SUCCESS &&
zend_hash_move_forward_ex(ht, &outer_pos)) {
}
the zend_hash_move_forward_ex(ht, &outer_pos) should return SUCCESS(0) on okey.
but this condition seems expect it return FAILURE...
not sure, what does it really want to do here :<
thanks
------------------------------------------------------------------------
[2016-01-22 18:49:03] bluewind at xinu dot at
Description:
------------
Finfo and releated functions throw a Notice for certain files when using php 7.0.2. This is not the
case when using 5.6.17.
Test script:
---------------
<?php
$a='#!env python
# -*- coding:utf-8 -*-
from serial import Serial
from sys import exit
';
$finfo = new finfo(FILEINFO_MIME_TYPE);
echo $finfo->buffer($a) . "\n";
Expected result:
----------------
text/x-python
Actual result:
--------------
Notice: Array to string conversion in /home/flo/test.php on line 9
text/x-python
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71434&edit=1