#49945 closed defect (bug) (fixed)
PHP 7.4+ notice in getid3_mp3::MPEGaudioHeaderValid()
Reported by: | schlessera | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | External Libraries | Keywords: | has-dev-note has-patch |
Focuses: | Cc: |
Description
The getid3_mp3::MPEGaudioHeaderValid()
method checks for an array key right at the beginning for an early return:
<?php public static function MPEGaudioHeaderValid($rawarray, $echoerrors=false, $allowBitrate15=false) { if (($rawarray['synch'] & 0x0FFE) != 0x0FFE) { return false; }
As it can receive its data from the MPEGaudioHeaderDecode()
method, which returns array|false
, a corrupted MP3 stream will cause this check throw a notice:
Notice: Trying to access array offset on value of type bool in wp-includes/ID3/module.audio.mp3.php on line 1782
This was already fixed upstream:
https://github.com/JamesHeinrich/getID3/blob/master/getid3/module.audio.mp3.php#L1794
This fix needs to be ported over to Core for PHP 7.4+ support.
Attachments (1)
Change History (19)
@
4 years ago
A patch to update all existing files in ID3 library to its current version. No new files are added, only modified local files. I doubt we have tests for them though.
#5
@
4 years ago
It looks like version 1.9.19 (released on Dec 18, 2019) does not include the PHP 7.4+ fix in question (committed on Dec 22, 2019), so it will have to be backported separately.
#7
@
4 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 47602:
#8
in reply to:
↑ 6
;
follow-up:
↓ 10
@
4 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
[47601] caused some failures on Travis:
Deprecated: Function get_magic_quotes_runtime() is deprecated in /var/www/build/wp-includes/ID3/getid3.php on line 303 Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/build/wp-includes/ID3/getid3.php on line 309 Deprecated: Function get_magic_quotes_runtime() is deprecated in /var/www/build/wp-includes/ID3/getid3.php on line 303 Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/build/wp-includes/ID3/getid3.php on line 309
Those lines have a version_compare(PHP_VERSION, '7.4.0', '<')
check above them, but for some reason are still executed in the PHP 7.4 job on Travis. It looks like php --version
on all jobs reports PHP 7.2.15
.
Those lines were previously commented out in [46113], but that was reverted in [47601] as seemingly not necessary with the version_compare()
check brought from upstream.
I guess we'll have to comment them out again for the time being, until we figure out why version_compare()
doesn't work.
#10
in reply to:
↑ 8
;
follow-up:
↓ 11
@
4 years ago
Replying to SergeyBiryukov:
Those lines have a
version_compare(PHP_VERSION, '7.4.0', '<')
check above them, but for some reason are still executed in the PHP 7.4 job on Travis. It looks likephp --version
on all jobs reportsPHP 7.2.15
.
Per @ocean90, the PHP version of Travis doesn't matter as we're using Docker. The issue seems to be that the PHP version of the Docker image is still 7.4.0RC6.
#11
in reply to:
↑ 10
@
4 years ago
Replying to SergeyBiryukov:
The issue seems to be that the PHP version of the Docker image is still 7.4.0RC6.
https://github.com/WordPress/wpdev-docker-images/pull/26 should fix this.
#13
@
4 years ago
- Keywords has-dev-note added
This getID3 update was noted in the following dev note: https://make.wordpress.org/core/2020/07/01/external-library-updates-in-wordpress-5-5-call-for-testing/
#14
@
4 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
There was a new version (v1.9.20) of getID3 released yesterday. Let us try to update to this version for WP 5.5
This ticket was mentioned in PR #376 on WordPress/wordpress-develop by desrosj.
4 years ago
#15
- Keywords has-patch added
Trac ticket: https://core.trac.wordpress.org/ticket/49945
4 years ago
#17
This was merged into core in https://core.trac.wordpress.org/changeset/48278.
There seems to be other fixes in the 1.9.19 release. I'll send a patch to update the version.