Skip to content

Commit 9a61bb0

Browse files
Merge pull request #1571 from Rouzax/fix/schema-arrayref-guards
Guard ReplayGain and URL tag processing against arrayrefs
2 parents 0b52aa3 + 957ed1b commit 9a61bb0

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Slim/Schema.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,7 @@ sub _createOrUpdateAlbum {
13051305
# Bug 8034, this used to not change gain/peak values if they were already set,
13061306
# bug we do want to update album gain tags if they are changed.
13071307
if ( $attributes->{$gainTag} ) {
1308+
$attributes->{$gainTag} = $attributes->{$gainTag}[0] if ref $attributes->{$gainTag} eq 'ARRAY';
13081309
$attributes->{$gainTag} =~ s/\s*dB//gi;
13091310
$attributes->{$gainTag} =~ s/\s//g; # bug 15965
13101311
$attributes->{$gainTag} =~ s/,/\./g; # bug 6900, change comma to period
@@ -2802,6 +2803,7 @@ sub _preCheckAttributes {
28022803
# Bug: 2605 - Get URL out of the attributes - some programs, and
28032804
# services such as www.allofmp3.com add it.
28042805
if ($attributes->{'URL'}) {
2806+
$attributes->{'URL'} = $attributes->{'URL'}[0] if ref $attributes->{'URL'} eq 'ARRAY';
28052807

28062808
push @$rawcomments, delete $attributes->{'URL'};
28072809
}
@@ -2921,6 +2923,7 @@ sub processReplayGainTags {
29212923
$shortTag =~ s/^REPLAYGAIN_TRACK_(\w+)$/REPLAY_$1/;
29222924

29232925
if (defined $attributes->{$gainTag}) {
2926+
$attributes->{$gainTag} = $attributes->{$gainTag}[0] if ref $attributes->{$gainTag} eq 'ARRAY';
29242927

29252928
$attributes->{$shortTag} = delete $attributes->{$gainTag};
29262929
$attributes->{$shortTag} =~ s/\s*dB//gi;

0 commit comments

Comments
 (0)