From 8af95f71c1816dd93a942e0ac75878c827466836 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Thu, 7 Apr 2022 05:50:46 +0000 Subject: [PATCH] Bug 30358: (follow-up) Inner newlines should be replaced with a space Signed-off-by: David Nind --- C4/AuthoritiesMarc.pm | 3 ++- C4/Biblio.pm | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index a79f61e45d8..5c48dbe6dde 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -646,7 +646,8 @@ sub AddAuthority { foreach my $subfield ( $field->subfields ) { my $key = $subfield->[0]; my $value = $subfield->[1]; - $value =~ s/^\s+|\s+$|\n+|\r+|^\t+|\t+$//g; + $value =~ s/^\s+|\s+$|^\t+|\t+$|^\n+|\n+$|^\r+|\r+$//g; + $value =~ s/\n+|\r+/ /g; $field->update( $key => $value ); } } diff --git a/C4/Biblio.pm b/C4/Biblio.pm index a861e5a1b70..296579530d2 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -2756,7 +2756,8 @@ sub ModBiblioMarc { foreach my $subfield ( $field->subfields ) { my $key = $subfield->[0]; my $value = $subfield->[1]; - $value =~ s/^\s+|\s+$|\n+|\r+|^\t+|\t+$//g; + $value =~ s/^\s+|\s+$|^\t+|\t+$|^\n+|\n+$|^\r+|\r+$//g; + $value =~ s/\n+|\r+/ /g; $field->update( $key => $value ); } } -- 2.20.1