Skip to content

Commit

Permalink
Fix array casting with DOM elements
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Dec 11, 2017
1 parent 255f2f1 commit b5f75ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions system/src/Grav/Common/Helpers/Excerpts.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static function getExcerptFromHtml($html, $tag)

foreach ($images as $image) {
$attributes = [];
foreach ((array)$image->attributes as $name => $value) {
foreach ($image->attributes as $name => $value) {
$attributes[$name] = $value->value;
}
$excerpt = [
Expand All @@ -88,7 +88,7 @@ public static function getHtmlFromExcerpt($excerpt)
$html = '<'.$element['name'];

if (isset($element['attributes'])) {
foreach ((array)$element['attributes'] as $name => $value) {
foreach ($element['attributes'] as $name => $value) {
if ($value === null) {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Helpers/Truncator.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private static function insertEllipsis($domNode, $ellipsis)
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));
Expand Down

0 comments on commit b5f75ac

Please sign in to comment.