Skip to content

Commit 6b6d2d1

Browse files
committed
External Libraries: Backport upstream PHP 8.5 fixes for getID3.
In absence of a new release, this cherry-picks [JamesHeinrich/getID3@8cb2923 8cb29233] and [JamesHeinrich/getID3@dbda40d dbda40de]. Props swissspidy, vidugupta, TobiasBg, desrosj. Fixes #64051. See #63061. git-svn-id: https://develop.svn.wordpress.org/trunk@60812 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c6cfbe9 commit 6b6d2d1

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/wp-includes/ID3/getid3.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,7 +1788,7 @@ public static function getFileSizeSyscall($path) {
17881788
$commandline = 'ls -l '.escapeshellarg($path).' | awk \'{print $5}\'';
17891789
}
17901790
if (isset($commandline)) {
1791-
$output = trim(`$commandline`);
1791+
$output = trim(shell_exec($commandline));
17921792
if (ctype_digit($output)) {
17931793
$filesize = (float) $output;
17941794
}

src/wp-includes/ID3/getid3.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ public function __construct() {
481481
if (strpos($value, ' ') !== false) {
482482
if (!empty($path_so_far)) {
483483
$commandline = 'dir /x '.escapeshellarg(implode(DIRECTORY_SEPARATOR, $path_so_far));
484-
$dir_listing = `$commandline`;
484+
$dir_listing = shell_exec($commandline);
485485
$lines = explode("\n", $dir_listing);
486486
foreach ($lines as $line) {
487487
$line = trim($line);
@@ -1809,7 +1809,7 @@ public function getHashdata($algorithm) {
18091809
if (file_exists(GETID3_HELPERAPPSDIR.'vorbiscomment.exe')) {
18101810

18111811
$commandline = '"'.GETID3_HELPERAPPSDIR.'vorbiscomment.exe" -w -c "'.$empty.'" "'.$file.'" "'.$temp.'"';
1812-
$VorbisCommentError = `$commandline`;
1812+
$VorbisCommentError = shell_exec($commandline);
18131813

18141814
} else {
18151815

@@ -1820,7 +1820,7 @@ public function getHashdata($algorithm) {
18201820
} else {
18211821

18221822
$commandline = 'vorbiscomment -w -c '.escapeshellarg($empty).' '.escapeshellarg($file).' '.escapeshellarg($temp).' 2>&1';
1823-
$VorbisCommentError = `$commandline`;
1823+
$VorbisCommentError = shell_exec($commandline);
18241824

18251825
}
18261826

src/wp-includes/ID3/module.audio.ogg.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -787,29 +787,29 @@ public function ParseVorbisComments() {
787787
switch ($index) {
788788
case 'rg_audiophile':
789789
case 'replaygain_album_gain':
790-
$info['replay_gain']['album']['adjustment'] = (double) $commentvalue[0];
790+
$info['replay_gain']['album']['adjustment'] = (float) $commentvalue[0];
791791
unset($info['ogg']['comments'][$index]);
792792
break;
793793

794794
case 'rg_radio':
795795
case 'replaygain_track_gain':
796-
$info['replay_gain']['track']['adjustment'] = (double) $commentvalue[0];
796+
$info['replay_gain']['track']['adjustment'] = (float) $commentvalue[0];
797797
unset($info['ogg']['comments'][$index]);
798798
break;
799799

800800
case 'replaygain_album_peak':
801-
$info['replay_gain']['album']['peak'] = (double) $commentvalue[0];
801+
$info['replay_gain']['album']['peak'] = (float) $commentvalue[0];
802802
unset($info['ogg']['comments'][$index]);
803803
break;
804804

805805
case 'rg_peak':
806806
case 'replaygain_track_peak':
807-
$info['replay_gain']['track']['peak'] = (double) $commentvalue[0];
807+
$info['replay_gain']['track']['peak'] = (float) $commentvalue[0];
808808
unset($info['ogg']['comments'][$index]);
809809
break;
810810

811811
case 'replaygain_reference_loudness':
812-
$info['replay_gain']['reference_volume'] = (double) $commentvalue[0];
812+
$info['replay_gain']['reference_volume'] = (float) $commentvalue[0];
813813
unset($info['ogg']['comments'][$index]);
814814
break;
815815

0 commit comments

Comments
 (0)