diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 0045e494edf..2568f9229d9 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -95,7 +95,8 @@ if ($_GET["action"] == 'specimen') // define constants for models generator that need parameters if ($_POST["action"] == 'setModuleOptions') { - for($i=0;$i < count($_POST);$i++) + $post_size=count($_POST); + for($i=0;$i < $post_size;$i++) { if (array_key_exists('param'.$i,$_POST)) { diff --git a/htdocs/admin/societe.php b/htdocs/admin/societe.php index 6fe20ccc94a..df6f8256d13 100644 --- a/htdocs/admin/societe.php +++ b/htdocs/admin/societe.php @@ -79,7 +79,8 @@ if ($_POST["action"] == 'usesearchtoselectcompany') // define constants for models generator that need parameters if ($_POST["action"] == 'setModuleOptions') { - for($i=0;$i < count($_POST);$i++) + $post_size=count($_POST); + for($i=0;$i < $post_size;$i++) { if (array_key_exists('param'.$i,$_POST)) { diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index 7414bce37bb..56e784b8664 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -200,7 +200,8 @@ class Facturation { } $tab=$ret; - for ( $i = 0; $i < count($tab); $i++ ) { + $tab_size=count($tab); + for($i=0;$i < $tab_size;$i++) { // Total HT $remise = $tab[$i]['remise']; diff --git a/htdocs/cashdesk/facturation_dhtml.php b/htdocs/cashdesk/facturation_dhtml.php index f5fd1b6bee4..1e27a12141e 100644 --- a/htdocs/cashdesk/facturation_dhtml.php +++ b/htdocs/cashdesk/facturation_dhtml.php @@ -81,7 +81,8 @@ if ( dol_strlen ($_GET["code"]) >= 0 ) // If search criteria is on char length a } $tab=$ret; - for ( $i = 0; $i < count ($tab); $i++ ) + $tab_size=count($tab); + for($i=0;$i < $tab_size;$i++) { $resultat .= '
  • tva(); - for ($i = 0; $i < count ($tab_tva); $i++) { + $tab_tva_size=count($tab_tva); + for($i=0;$i < $tab_tva_size;$i++) { if ( $tva_tx == $tab_tva[$i]['taux'] ) $selected = 'selected="selected"'; diff --git a/htdocs/cashdesk/tpl/liste_articles.tpl.php b/htdocs/cashdesk/tpl/liste_articles.tpl.php index 4079ba529a0..38324955f0f 100644 --- a/htdocs/cashdesk/tpl/liste_articles.tpl.php +++ b/htdocs/cashdesk/tpl/liste_articles.tpl.php @@ -44,7 +44,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. } $tab = $ret; - for ( $i = 0; $i < count($tab); $i++ ) { + $tab_size=count($tab); + for($i=0;$i < $tab_size;$i++) { echo ('
    '."\n"); echo ('

    '.$tab[$i]['ref'].' - '.$tab[$i]['label'].'

    '."\n"); diff --git a/htdocs/cashdesk/tpl/ticket.tpl.php b/htdocs/cashdesk/tpl/ticket.tpl.php index e5b62951ddb..8d7ebb1e54d 100644 --- a/htdocs/cashdesk/tpl/ticket.tpl.php +++ b/htdocs/cashdesk/tpl/ticket.tpl.php @@ -133,7 +133,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. } $tab = $ret; - for ( $i = 0; $i < count($tab); $i++ ) { + $tab_size=count($tab); + for($i=0;$i < $tab_size;$i++) { $remise = $tab[$i]['remise']; echo (''.$tab[$i]['ref'].''.$tab[$i]['label'].''.$tab[$i]['qte'].''.$tab[$i]['remise_percent'].''.price2num($tab[$i]['total_ht'],'MT').' '.$conf->monnaie.''."\n"); diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index 312c00bb59c..80d623b11f9 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -153,7 +153,8 @@ switch ( $_GET['action'] ) } $tab_liste = $ret; // Loop on each product - for ($i = 0; $i < count ($tab_liste); $i++) + $tab_liste_size=count($tab_liste); + for($i=0;$i < $tab_liste_size;$i++) { // Recuperation de l'article $res = $db->query ( diff --git a/htdocs/lib/CMailFile.class.php b/htdocs/lib/CMailFile.class.php index 85c02046480..2c51bbcaffb 100644 --- a/htdocs/lib/CMailFile.class.php +++ b/htdocs/lib/CMailFile.class.php @@ -554,7 +554,8 @@ class CMailFile if ($filename_list) { - for ($i = 0; $i < count($filename_list); $i++) + $filename_list_size=count($filename_list); + for($i=0;$i < $filename_list_size;$i++) { if ($filename_list[$i]) { @@ -677,7 +678,8 @@ class CMailFile { $out = ''; - for ($i = 0; $i < count($filename_list); $i++) + $filename_list_size=count($filename_list); + for($i=0;$i < $filename_list_size;$i++) { if ($filename_list[$i]) {