From 58bb853757b756cfc9f0cbcd85f5f81de92cd477 Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Wed, 22 Jun 2022 10:01:36 -0300 Subject: [PATCH] Escapes document url before comparing with embeded on document_as_html. --- src/classes/entities/class-tainacan-item.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/classes/entities/class-tainacan-item.php b/src/classes/entities/class-tainacan-item.php index 48ff44919..fbe3b9a08 100644 --- a/src/classes/entities/class-tainacan-item.php +++ b/src/classes/entities/class-tainacan-item.php @@ -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('', $url, $url);