summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tdd-bootstrap.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/tdd-bootstrap.php b/tdd-bootstrap.php
index 9d7998d..2ed216b 100644
--- a/tdd-bootstrap.php
+++ b/tdd-bootstrap.php
@@ -65,6 +65,15 @@ class Protocol {
$dom->find('/html/body/table/tr', 0)->outertext = '';
}
+ // replacing meta http-equiv refresh with a javascript refresh to preserve hash in the result page
+ $meta = $head->find('meta');
+ foreach ($meta as $metaTag) {
+ if ($metaTag->hasAttribute('http-equiv') && strtolower($metaTag->getAttribute('http-equiv')) == 'refresh') {
+ $head->innertext = str_replace($metaTag->outertext, '', $head->innertext) . '<script type="text/javascript">setTimeout(function() { location.reload(); }, ' . ($metaTag->getAttribute('content') * 1000) . ');</script>';
+ break;
+ }
+ }
+
print $dom->outertext;
}