Make WordPress Core


Ignore:
Timestamp:
07/02/2020 03:46:17 PM (5 years ago)
Author:
desrosj
Message:

External Libraries: Update getID3 to version 1.9.20.

A full list of changes in this update can be found on GitHub: https://github.com/JamesHeinrich/getID3/compare/v1.9.19...v1.9.20.

Props hareesh-pillai, desrosj.
Previously [47601-47604].
Fixes #49945.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ID3/module.tag.id3v2.php

    r47601 r48278  
    1515/////////////////////////////////////////////////////////////////
    1616
     17if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
     18    exit;
     19}
    1720getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v1.php', __FILE__, true);
    1821
     
    521524            // note: MusicBrainz Picard incorrectly stores plaintext genres separated by "/" when writing in ID3v2.3 mode, hack-fix here:
    522525            // replace / with NULL, then replace back the two ID3v1 genres that legitimately have "/" as part of the single genre name
    523             if (preg_match('#/#', $genrestring)) {
     526            if (strpos($genrestring, '/') !== false) {
     527                $LegitimateSlashedGenreList = array(  // https://github.com/JamesHeinrich/getID3/issues/223
     528                    'Pop/Funk',    // ID3v1 genre #62 - https://en.wikipedia.org/wiki/ID3#standard
     529                    'Cut-up/DJ',   // Discogs - https://www.discogs.com/style/cut-up/dj
     530                    'RnB/Swing',   // Discogs - https://www.discogs.com/style/rnb/swing
     531                    'Funk / Soul', // Discogs (note spaces) - https://www.discogs.com/genre/funk+%2F+soul
     532                );
    524533                $genrestring = str_replace('/', "\x00", $genrestring);
    525                 $genrestring = str_replace('Pop'."\x00".'Funk', 'Pop/Funk', $genrestring);
    526                 $genrestring = str_replace('Rock'."\x00".'Rock', 'Folk/Rock', $genrestring);
     534                foreach ($LegitimateSlashedGenreList as $SlashedGenre) {
     535                    $genrestring = str_ireplace(str_replace('/', "\x00", $SlashedGenre), $SlashedGenre, $genrestring);
     536                }
    527537            }
    528538
    529539            // some other taggers separate multiple genres with semicolon, e.g. "Heavy Metal;Thrash Metal;Metal"
    530             if (preg_match('#;#', $genrestring)) {
     540            if (strpos($genrestring, ';') !== false) {
    531541                $genrestring = str_replace(';', "\x00", $genrestring);
    532542            }
Note: See TracChangeset for help on using the changeset viewer.