From 22e15113018c88389fa9d375cc09c6394ac6be4a Mon Sep 17 00:00:00 2001 From: Takayuki Miyoshi Date: Sun, 4 Dec 2022 15:37:34 +0900 Subject: [PATCH] Normalize placeholder #1068 --- includes/form-tags-manager.php | 3 +++ includes/formatting.php | 2 -- load.php | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/form-tags-manager.php b/includes/form-tags-manager.php index 6ddc3590..eba484f6 100644 --- a/includes/form-tags-manager.php +++ b/includes/form-tags-manager.php @@ -290,6 +290,9 @@ public function replace_with_placeholders( $content ) { ); } + list( $placeholder ) = + WPCF7_HTMLFormatter::normalize_start_tag( $placeholder ); + $this->placeholders[$placeholder] = $tag; return $placeholder; diff --git a/includes/formatting.php b/includes/formatting.php index 8813a58c..bea27cd1 100644 --- a/includes/formatting.php +++ b/includes/formatting.php @@ -7,8 +7,6 @@ * @return string Text which has been converted into correct paragraph tags. */ function wpcf7_autop( $input ) { - require_once WPCF7_PLUGIN_DIR . '/includes/html-formatter.php'; - $formatter = new WPCF7_HTMLFormatter(); $chunks = $formatter->separate_into_chunks( $input ); diff --git a/load.php b/load.php index 9073c4bb..17a764cd 100644 --- a/load.php +++ b/load.php @@ -24,6 +24,7 @@ require_once WPCF7_PLUGIN_DIR . '/includes/config-validator.php'; require_once WPCF7_PLUGIN_DIR . '/includes/rest-api.php'; require_once WPCF7_PLUGIN_DIR . '/includes/block-editor/block-editor.php'; +require_once WPCF7_PLUGIN_DIR . '/includes/html-formatter.php'; if ( is_admin() ) { require_once WPCF7_PLUGIN_DIR . '/admin/admin.php';