kenzzii / mtchart

Automatically exported from code.google.com/p/mtchart
GNU General Public License v3.0
0 stars 0 forks source link

Division by zero if XInterval = 0 #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
i know this shouldn't occur and it's up to the user to set a correct
xinterval but anyway mtChart should not throw an error?! what you think?

Warning (2): Division by zero [/mtChart/mtChart.php, line 769]

769: if($ID == 0 || $ID % $this->XInterval == 0) {

patch:

just do a checkup before entering the loop after line 766

if (!$this->XInterval) {
    $this->XInterval = 1;
    # or throw an error
    die('please set up a correct XInterval value!');
}

Original issue reported on code.google.com by repthe...@gmail.com on 30 Sep 2009 at 9:17