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-bootstrap.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'tdd-bootstrap.php') diff --git a/tdd-bootstrap.php b/tdd-bootstrap.php index 9f874a3..48b088f 100644 --- a/tdd-bootstrap.php +++ b/tdd-bootstrap.php @@ -24,7 +24,6 @@ class Protocol { function output() { $content = file_get_contents($this->get_filename()); - $modified = 0; $dom = str_get_html($content); $header_td1 = $dom->find("/html/body/table/tr/td[class=\"bdcc12\"]", 0); @@ -48,7 +47,6 @@ class Protocol { if(($score1 !== '' || strpos($contract1, 'A') === 0) && ($score2 !== '' || strpos($contract2, 'A') === 0)) { $insert .= $deal->html(); - $modified = 1; } else { $insert .= '

...

'; } @@ -58,12 +56,10 @@ class Protocol { $tr = @$tr->next_sibling(); } - if($modified) { - $header_tr2 = $header_tr->next_sibling(); - $header_tr->outertext = ''; - $header_tr2->outertext = ''; - $dom->find('/html/body/table/tr', 0)->outertext = ''; - } + $header_tr2 = $header_tr->next_sibling(); + $header_tr->outertext = ''; + $header_tr2->outertext = ''; + $dom->find('/html/body/table/tr', 0)->outertext = ''; $head = $dom->find('/html/head', 0); $head->innertext .= '' -- cgit v1.2.3