From 4e91dd3b096afbd8e05fa052001589308e29405b Mon Sep 17 00:00:00 2001 From: emkael Date: Sun, 4 Feb 2018 13:05:14 +0100 Subject: Passing through unchanged original HTML file if no deal files are found --- tdd-protocol.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tdd-protocol.php') diff --git a/tdd-protocol.php b/tdd-protocol.php index 7f6eb7b..3dcc0d8 100644 --- a/tdd-protocol.php +++ b/tdd-protocol.php @@ -18,7 +18,12 @@ if($request_uri_ending != '/' . $html_filename) { // $deals_by_tables = load_deals_for_tables($prefix, $round, $board); -foreach($deals_by_tables as $table => $deal) { - $protocol->set_deal($table, $deal); +if (count($deals_by_tables) > 0) { + foreach($deals_by_tables as $table => $deal) { + $protocol->set_deal($table, $deal); + } + echo $protocol->output(); +} +else { + readfile($html_filename); } -echo $protocol->output(); -- cgit v1.2.3