Escapes document url before comparing with embeded on document_as_html.

This commit is contained in:
mateuswetah 2022-06-22 10:01:36 -03:00
parent 08f1d7361c
commit 58bb853757
1 changed files with 3 additions and 3 deletions

View File

@ -711,16 +711,16 @@ class Item extends Entity {
$document_options = $this->get_document_options();
$output = '';
if ( $type == 'url' ) {
global $wp_embed;
$_embed = $wp_embed->autoembed($this->get_document());
$url = $this->get_document();
if ( $_embed == $url ) {
if ( esc_url($_embed) == esc_url($url) ) {
if ( $document_options && isset($document_options['forced_iframe']) && $document_options['forced_iframe'] === true ) {
// URL points to an image file
if (isset($document_options['is_image']) && $document_options['is_image'] === true) {
$_embed = sprintf('<a href="%s" target="blank"><img src="%s" /></a>', $url, $url);