From 8505ebd2ae150072d67af84326e4076917fb7f8b Mon Sep 17 00:00:00 2001 From: mxkae Date: Wed, 4 Oct 2023 09:25:38 +0800 Subject: [PATCH] unescaped unicode, include
--- src/block/accordion/index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/block/accordion/index.php b/src/block/accordion/index.php index c39048c8d..cef9367cf 100644 --- a/src/block/accordion/index.php +++ b/src/block/accordion/index.php @@ -94,8 +94,8 @@ public function get_faq_answer( $block, $answer ) { if ( $count_inner_blocks == 0 ) { // check if it contains a text if ( trim( wp_strip_all_tags( $block[ 'innerHTML' ], true ) ) != '' ) { - // return the text without tags - return $answer . trim( wp_strip_all_tags( $block[ 'innerHTML'], true ) ); + // return the text after stripping all tags except
+ return $answer . trim( strip_tags( $block[ 'innerHTML'], ["
"] ) ); } return $answer; } @@ -129,10 +129,10 @@ public function render_block_accordion_faq_schema( $block_content, $block ) { $this->faq_entities[] = '{ "@type": "Question", - "name": ' . json_encode( $question ) . ', + "name": ' . json_encode( $question, JSON_UNESCAPED_UNICODE ) . ', "acceptedAnswer": { "@type": "Answer", - "text": ' . json_encode( $answer ) .' + "text": ' . json_encode( $answer, JSON_UNESCAPED_UNICODE ) .' } }'; }