mirror of
https://github.com/getgrav/grav.git
synced 2026-07-20 07:12:14 +02:00
Fix array casting with DOM elements
This commit is contained in:
@@ -62,7 +62,7 @@ class Excerpts
|
||||
|
||||
foreach ($images as $image) {
|
||||
$attributes = [];
|
||||
foreach ((array)$image->attributes as $name => $value) {
|
||||
foreach ($image->attributes as $name => $value) {
|
||||
$attributes[$name] = $value->value;
|
||||
}
|
||||
$excerpt = [
|
||||
@@ -88,7 +88,7 @@ class Excerpts
|
||||
$html = '<'.$element['name'];
|
||||
|
||||
if (isset($element['attributes'])) {
|
||||
foreach ((array)$element['attributes'] as $name => $value) {
|
||||
foreach ($element['attributes'] as $name => $value) {
|
||||
if ($value === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ class Truncator {
|
||||
private static function innerHTML($element) {
|
||||
$innerHTML = '';
|
||||
$children = $element->childNodes;
|
||||
foreach ((array)$children as $child)
|
||||
foreach ($children as $child)
|
||||
{
|
||||
$tmp_dom = new DOMDocument();
|
||||
$tmp_dom->appendChild($tmp_dom->importNode($child, true));
|
||||
|
||||
Reference in New Issue
Block a user