php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81462 mime_content_type() indicates wrong arg num on TypeError
Submitted: 2021-09-20 21:46 UTC Modified: -
From: girgias@php.net Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 8.0.11RC1 OS:
Private report: No CVE-ID: None
 [2021-09-20 21:46 UTC] girgias@php.net
Description:
------------
mime_content_type() indicates the wrong argument number when a TypeError is emitted.

Test script:
---------------
try {
    mime_content_type(1);
} catch (\TypeError $e) {
    echo $e->getMessage() . \PHP_EOL;
}

Expected result:
----------------
mime_content_type(): Argument #1 ($filename) must be of type resource|string, int given

Actual result:
--------------
mime_content_type(): Argument #2 must be of type resource|string, int given

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-09-20 21:49 UTC] git@php.net
Automatic comment on behalf of Girgias
Revision: https://github.com/php/php-src/commit/0ea38b950939f362898c4114672566ec7c561b2f
Log: Fix Bug #81462 mime_content_type() indicates wrong arg num on TypeError
 [2021-09-20 21:49 UTC] git@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Dec 06 04:05:54 2022 UTC