@@ -181,8 +181,8 @@ private static function restore( array $blocks, &$images = 0 ) {
181181 /**
182182 * Let the tags these blocks save through kses, for a comment that holds them.
183183 *
184- * @param array $tags Allowed tags.
185- * @param string $context The kses context.
184+ * @param array|mixed $tags Allowed tags. Null when an earlier filter drops them .
185+ * @param string $context The kses context.
186186 * @return array
187187 */
188188 public function allowed_html ( $ tags , $ context ) {
@@ -191,7 +191,7 @@ public function allowed_html( $tags, $context ) {
191191 }
192192
193193 return array_merge (
194- $ tags ,
194+ ( array ) $ tags ,
195195 array (
196196 'p ' => array (),
197197 'br ' => array (),
@@ -218,12 +218,12 @@ public function allowed_html( $tags, $context ) {
218218 /**
219219 * The comment's HTML without the block delimiters, and without any block the editor does not offer.
220220 *
221- * @param string $content Comment content.
221+ * @param string|mixed $content Comment content.
222222 * @param \WP_Comment|null $comment The comment, where the caller has it.
223- * @return string
223+ * @return string|mixed
224224 */
225225 public static function render ( $ content , $ comment = null ) {
226- if ( ! has_blocks ( $ content ) ) {
226+ if ( ! is_string ( $ content ) || ! has_blocks ( $ content ) ) {
227227 return $ content ;
228228 }
229229
@@ -237,11 +237,15 @@ public static function render( $content, $comment = null ) {
237237 /**
238238 * Core's comment email, with the comment's block markup replaced by the text it draws.
239239 *
240- * @param string $message The email body.
241- * @param int $comment_id The comment the email is about.
242- * @return string
240+ * @param string|mixed $message The email body.
241+ * @param int $comment_id The comment the email is about.
242+ * @return string|mixed
243243 */
244244 public static function render_in_email ( $ message , $ comment_id ) {
245+ if ( ! is_string ( $ message ) ) {
246+ return $ message ;
247+ }
248+
245249 $ comment = get_comment ( $ comment_id );
246250
247251 if ( ! $ comment instanceof \WP_Comment || ! has_blocks ( $ comment ->comment_content ) ) {
0 commit comments