outputhtml works on PHP 5.4

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2820 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2016-06-29 12:50:19 +00:00
parent 09eda99eaf
commit aadfae008a

View File

@@ -100,11 +100,11 @@ EOT;
as $key=>$val) as $key=>$val)
{ {
$files = $dom->getElementsByTagName ($key); $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; continue;
$src = $files[$i]->getAttribute ($val); $src = $file->getAttribute ($val);
if ($src === "") if ($src === "")
continue; continue;
if (substr ($src, 0, 7) === "http://" || if (substr ($src, 0, 7) === "http://" ||
@@ -121,12 +121,10 @@ EOT;
$srcHash = filemtime ($srcFile); $srcHash = filemtime ($srcFile);
else else
$srcHash = time(); $srcHash = time();
$dom->getElementsByTagName ($key)[$i]->setAttribute ($val, $file->setAttribute ($val, "$src?$srcHash");
"$src?$srcHash");
} }
} }
echo $dom->saveHTML();exit; echo $dom->saveHTML();
echo $resView;
if (!defined ("PHPUNIT")) if (!defined ("PHPUNIT"))
exit; exit;
} }