Changeset 48278 for trunk/src/wp-includes/ID3/module.tag.id3v2.php
- Timestamp:
- 07/02/2020 03:46:17 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ID3/module.tag.id3v2.php
r47601 r48278 15 15 ///////////////////////////////////////////////////////////////// 16 16 17 if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers 18 exit; 19 } 17 20 getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v1.php', __FILE__, true); 18 21 … … 521 524 // note: MusicBrainz Picard incorrectly stores plaintext genres separated by "/" when writing in ID3v2.3 mode, hack-fix here: 522 525 // 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 ); 524 533 $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 } 527 537 } 528 538 529 539 // 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) { 531 541 $genrestring = str_replace(';', "\x00", $genrestring); 532 542 }
Note: See TracChangeset
for help on using the changeset viewer.