29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-28 08:03:40 +00:00

Fix incorrect HTML rendering (#40194)

This commit is contained in:
Fedir Zinchuk 2023-03-25 20:42:04 +02:00 committed by GitHub
parent 9af564de5d
commit 7644c36c72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,11 @@ foreach ($modules as $key => $mod) {
$dom->loadHTML('<?xml encoding="utf-8" ?>' . $out);
$els = $dom->getElementsByTagName('a');
$moduleCollapsedHtml[] = $dom->saveHTML($els[0]); //$els[0]->nodeValue;
if ($els[0]) {
$moduleCollapsedHtml[] = $dom->saveHTML($els[0]);
} else {
$moduleCollapsedHtml[] = $out;
}
} else {
$moduleCollapsedHtml[] = $out;
}