diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 87fce1f60877b..b86023aa49a11 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -1,6 +1,7 @@ * Copyright (C) 2015 Frederic France + * Copyright (C) 2016 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -377,7 +378,8 @@ function gzdecode($data) if ($ret > 0) { setEventMessages($printer->error, $printer->errors, 'errors'); } else { - for ($line=0; $line < count($printer->listprinterstemplates); $line++) { + $max = count($printer->listprinterstemplates); + for ($line=0; $line < $max; $line++) { $var = !$var; print ''; if ($action=='edittemplate' && $printer->listprinterstemplates[$line]['rowid']==$templateid) { @@ -422,7 +424,8 @@ function gzdecode($data) print ''.$langs->trans("Tag").''; print ''.$langs->trans("Description").''; print "\n"; - for ($tag=0; $tag < count($printer->tags); $tag++) { + $max = count($printer->tags); + for ($tag=0; $tag < $max; $tag++) { $var = !$var; print ''; print '<'.$printer->tags[$tag].'>'.$langs->trans(strtoupper($printer->tags[$tag])).'';