[wp-trac] [WordPress Trac] #49945: PHP 7.4+ notice in getid3_mp3::MPEGaudioHeaderValid()

WordPress Trac noreply at wordpress.org
Sat Apr 18 06:29:48 UTC 2020


#49945: PHP 7.4+ notice in getid3_mp3::MPEGaudioHeaderValid()
--------------------------+-----------------------------
 Reporter:  schlessera    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The `getid3_mp3::MPEGaudioHeaderValid()` method checks for an array key
 right at the beginning for an early return:
 {{{#!php
 <?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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49945>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list