From aadfae008aa679eaa449319a7d08a6945e6262bb Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Wed, 29 Jun 2016 12:50:19 +0000 Subject: [PATCH] outputhtml works on PHP 5.4 git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2820 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- outputhtml.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/outputhtml.php b/outputhtml.php index c0a35db..b2234ba 100644 --- a/outputhtml.php +++ b/outputhtml.php @@ -100,11 +100,11 @@ EOT; as $key=>$val) { $files = $dom->getElementsByTagName ($key); - for ($i = 0 ; $i < $files->length ; $i++) + foreach ($files as $id=>$file) { - if ($files[$i]->hasAttribute ($val) === false) + if ($file->hasAttribute ($val) === false) continue; - $src = $files[$i]->getAttribute ($val); + $src = $file->getAttribute ($val); if ($src === "") continue; if (substr ($src, 0, 7) === "http://" || @@ -121,12 +121,10 @@ EOT; $srcHash = filemtime ($srcFile); else $srcHash = time(); - $dom->getElementsByTagName ($key)[$i]->setAttribute ($val, - "$src?$srcHash"); + $file->setAttribute ($val, "$src?$srcHash"); } } - echo $dom->saveHTML();exit; - echo $resView; + echo $dom->saveHTML(); if (!defined ("PHPUNIT")) exit; }