Skip to content

Commit

Permalink
Merge pull request #435 from StudioMaX/php53fix
Browse files Browse the repository at this point in the history
Compatibility fix for PHP 5.3
  • Loading branch information
JamesHeinrich authored Feb 1, 2024
2 parents 23e4a2c + 448085f commit 3bcea90
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions getid3/module.audio-video.riff.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ public function Analyze() {
// Keep only string as far as first null byte, discard rest of fixed-width data
// https://github.com/JamesHeinrich/getID3/issues/263
// https://github.com/JamesHeinrich/getID3/issues/430
$thisfile_riff_WAVE_bext_0[$bext_key] = explode("\x00", $thisfile_riff_WAVE_bext_0[$bext_key])[0];
$null_terminator_rows = explode("\x00", $thisfile_riff_WAVE_bext_0[$bext_key]);
$thisfile_riff_WAVE_bext_0[$bext_key] = $null_terminator_rows[0];
}

$thisfile_riff_WAVE_bext_0['origin_date'] = substr($thisfile_riff_WAVE_bext_0['data'], 320, 10);
Expand Down Expand Up @@ -1133,7 +1134,8 @@ public function Analyze() {
foreach ($CommentsChunkNames as $key => $value) {
if (isset($thisfile_riff[$RIFFsubtype][$key][0]['data'])) {
// https://github.com/JamesHeinrich/getID3/issues/430
$thisfile_riff['comments'][$value][] = explode("\x00", $thisfile_riff[$RIFFsubtype][$key][0]['data'])[0];
$null_terminator_rows = explode("\x00", $thisfile_riff[$RIFFsubtype][$key][0]['data']);
$thisfile_riff['comments'][$value][] = $null_terminator_rows[0];
}
}
/*
Expand Down Expand Up @@ -1226,7 +1228,8 @@ public function Analyze() {
foreach ($CommentsChunkNames as $key => $value) {
if (isset($thisfile_riff[$RIFFsubtype][$key][0]['data'])) {
// https://github.com/JamesHeinrich/getID3/issues/430
$thisfile_riff['comments'][$value][] = explode("\x00", $thisfile_riff[$RIFFsubtype][$key][0]['data'])[0];
$null_terminator_rows = explode("\x00", $thisfile_riff[$RIFFsubtype][$key][0]['data']);
$thisfile_riff['comments'][$value][] = $null_terminator_rows[0];
}
}

Expand Down

0 comments on commit 3bcea90

Please sign in to comment.