diff options
author | Michal Zimniewicz <michzimny@gmail.com> | 2018-02-03 22:22:58 +0100 |
---|---|---|
committer | Michal Zimniewicz <michzimny@gmail.com> | 2018-02-03 22:23:29 +0100 |
commit | 8f49020717fb7f33d3fd5d4264c1c419c1e65a5c (patch) | |
tree | 11e3fe6b9532fe340f3e1daafc91c430b3bef539 /tdd-bootstrap.php | |
parent | 794a1fd682fa39d21a4fcc12c7065ca751acd576 (diff) |
refactor deletion of http-equiv=refresh
Diffstat (limited to 'tdd-bootstrap.php')
-rw-r--r-- | tdd-bootstrap.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tdd-bootstrap.php b/tdd-bootstrap.php index 79320b6..255e535 100644 --- a/tdd-bootstrap.php +++ b/tdd-bootstrap.php @@ -74,7 +74,8 @@ class Protocol { $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>'; + $head->innertext .= '<script type="text/javascript">setTimeout(function() { location.reload(); }, ' . ($metaTag->getAttribute('content') * 1000) . ');</script>'; + $metaTag->outertext = ''; // delete $metaTag break; } } |