From 38e8bcc7663841bdf53423654632efa0804faa3d Mon Sep 17 00:00:00 2001 From: Phyks Date: Sat, 9 Nov 2013 18:00:00 +0100 Subject: [PATCH] Bug correction in Invoices class There was an error in Invoices class, leading to an undefined result if the user was not in the invoice. --- inc/Invoices.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/Invoices.class.php b/inc/Invoices.class.php index 16d7611..b12e099 100644 --- a/inc/Invoices.class.php +++ b/inc/Invoices.class.php @@ -97,7 +97,7 @@ } // Amount is stored in cents - return round($this->amount / 100 / (count($users_in) + $guests) * (1 + $users_in[(int) $id]), 2); // Note : $users_in[(int) $id] is the number of guests for user $id + return (isset($users_in[(int) $id])) ? round($this->amount / 100 / (count($users_in) + $guests) * (1 + $users_in[(int) $id]), 2) : 0; // Note : $users_in[(int) $id] is the number of guests for user $id } // Maps htmlspecialchars on the class before display