From e10f011dd1e639a5291728ef501d0918b049b713 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 12 Jan 2016 16:49:15 +0100 Subject: [PATCH] Bug 15572: TransformHtmlToMarc - rewrite the loop MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This rewrites the while loop into a for loop, so $i still gets incremented when we call next Signed-off-by: Frédéric Demians Make sense. Add readability. Infinite loop no more possible. Signed-off-by: Jonathan Druart Signed-off-by: Jesse Weaver (cherry picked from commit 1eab5c199d21a622abde7e47ca248d80e882ca46) Signed-off-by: Julian Maurice --- C4/Biblio.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 50f679c836..f9e5efb5ab 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -2515,13 +2515,12 @@ sub TransformHtmlToMarc { # creating a new record my $record = MARC::Record->new(); - my $i = 0; my @fields; my ($biblionumbertagfield, $biblionumbertagsubfield) = (-1, -1); ($biblionumbertagfield, $biblionumbertagsubfield) = &GetMarcFromKohaField( "biblio.biblionumber", '' ) if $isbiblio; #FIXME This code assumes that the CGI params will be in the same order as the fields in the template; this is no absolute guarantee! - while ( $params[$i] ) { # browse all CGI params + for (my $i = 0; $params[$i]; $i++ ) { # browse all CGI params my $param = $params[$i]; my $newfield = 0; @@ -2585,7 +2584,6 @@ sub TransformHtmlToMarc { } push @fields, $newfield if ($newfield); } - $i++; } $record->append_fields(@fields); -- 2.39.5