Skip to content

Commit

Permalink
fix: return HTML instead of HtmlPageCrawler object (#1832)
Browse files Browse the repository at this point in the history
Update the filters that use an HtmlPageCrawler to return the
outerHTML of the HtmlPageCrawler, rather than the object.

This will fix the regression seen with the WordPress 6.6
release that is causing those filters to fail with a fatal
error.
  • Loading branch information
patheard authored Jul 18, 2024
1 parent 23943a9 commit b1a4fd5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function cds_filter_core_buttons($block_content, $block)
$links .= $link;
}

return $links;
return $links->outerHtml();
} catch (Exception $e) {
//no-op
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function cds_filter_core_image($block_content, $block)
// add the following styles to prevent the image from being improperly sized
$img_html->css('max-width', '100%');
$img_html->css('height', 'auto');
return $img_html;
return $img_html->outerHtml();
} catch (Exception $e) {
//no-op
}
Expand Down

0 comments on commit b1a4fd5

Please sign in to comment.