Author: danydb
Date: 2013-12-08 21:45:04 +0100 (Sun, 08 Dec 2013)
New Revision: 601

Modified:
   trunk/rapport_avance/include/class_rapav_listing_formula.php
Log:
protect againt division by zero

Modified: trunk/rapport_avance/include/class_rapav_listing_formula.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_listing_formula.php        
2013-12-08 20:41:46 UTC (rev 600)
+++ trunk/rapport_avance/include/class_rapav_listing_formula.php        
2013-12-08 20:45:04 UTC (rev 601)
@@ -428,7 +428,12 @@
                                 ', array($this->detail->lc_id, 
$search,$this->fiche->f_id));
             $formula = str_replace($piece, $value, $formula);
         }
-        eval('$amount = ' . $formula . ';');
+        if ( strpos("1".$formula,"/0.0000") != 0)
+        {
+            $amount=0;
+        } else {
+            eval('$amount = ' . $formula . ';');
+        }
         //
         $this->detail->ld_value_numeric= $amount;
     }



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu

_______________________________________________
Phpcompta  est un logiciel libre de comptabilité en ligne 
(http://www.phpcompta.eu)
Phpcompta-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/phpcompta-dev

Reply via email to