From 8184a8ddbb5c92cf3b01806c7a4f6172c95c7ed3 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 12 Feb 2013 09:07:34 -0200 Subject: Check if file exists before try to read it. Fixes #2764 --- usr/local/www/status_captiveportal_vouchers.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'usr/local') diff --git a/usr/local/www/status_captiveportal_vouchers.php b/usr/local/www/status_captiveportal_vouchers.php index 542dd1b..3bee04d 100644 --- a/usr/local/www/status_captiveportal_vouchers.php +++ b/usr/local/www/status_captiveportal_vouchers.php @@ -72,6 +72,10 @@ $db = array(); foreach($a_roll as $rollent) { $roll = $rollent['number']; $minutes = $rollent['minutes']; + + if (!file_exists("{$g['vardb_path']}/voucher_{$cpzone}_active_$roll.db")) + continue; + $active_vouchers = file("{$g['vardb_path']}/voucher_{$cpzone}_active_$roll.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); foreach($active_vouchers as $voucher => $line) { list($voucher,$timestamp, $minutes) = explode(",", $line); -- cgit v1.1