From 5e7018e9f2bdb2b8490eb6c95a6d5ca8646729b0 Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Fri, 27 Sep 2024 14:48:23 +0300 Subject: [PATCH] * checking not empty $match; --- includes/core/class-form.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/core/class-form.php b/includes/core/class-form.php index 780cccb8..c7a89c42 100644 --- a/includes/core/class-form.php +++ b/includes/core/class-form.php @@ -759,8 +759,10 @@ if ( ! class_exists( 'um\core\Form' ) ) { case 'textarea': if ( ! empty( $field['html'] ) || ( UM()->profile()->get_show_bio_key( $form ) === $k && UM()->options()->get( 'profile_show_html_bio' ) ) ) { $form[ $k ] = html_entity_decode( $form[ $k ] ); // required because WP_Editor send sometimes encoded content. - preg_match('/^

(.*?)<\/p>$/', $form[ $k ], $match ); - $form[ $k ] = $match[1]; // required because WP_Editor send content wrapped to

+ preg_match( '/^

(.*?)<\/p>$/', $form[ $k ], $match ); // required because WP_Editor send content wrapped to

+ if ( ! empty( $match[1] ) ) { + $form[ $k ] = $match[1]; + } $allowed_html = UM()->get_allowed_html( 'templates' ); if ( empty( $allowed_html['iframe'] ) ) {