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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: girgias@php.net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC