auto-patch 673-dev-dev01-2024-05-25T22_41_57
This commit is contained in:
@@ -7,46 +7,7 @@ add_action(
|
||||
);
|
||||
|
||||
function wpcf7_init_block_editor_assets() {
|
||||
$assets = array();
|
||||
|
||||
$asset_file = wpcf7_plugin_path(
|
||||
'includes/block-editor/index.asset.php'
|
||||
);
|
||||
|
||||
if ( file_exists( $asset_file ) ) {
|
||||
$assets = include( $asset_file );
|
||||
}
|
||||
|
||||
$assets = wp_parse_args( $assets, array(
|
||||
'dependencies' => array(
|
||||
'react',
|
||||
'wp-api-fetch',
|
||||
'wp-block-editor',
|
||||
'wp-blocks',
|
||||
'wp-components',
|
||||
'wp-element',
|
||||
'wp-i18n',
|
||||
'wp-url',
|
||||
),
|
||||
'version' => WPCF7_VERSION,
|
||||
) );
|
||||
|
||||
wp_register_script(
|
||||
'contact-form-7-block-editor',
|
||||
wpcf7_plugin_url( 'includes/block-editor/index.js' ),
|
||||
$assets['dependencies'],
|
||||
$assets['version']
|
||||
);
|
||||
|
||||
wp_set_script_translations(
|
||||
'contact-form-7-block-editor',
|
||||
'contact-form-7'
|
||||
);
|
||||
|
||||
register_block_type(
|
||||
wpcf7_plugin_path( 'includes/block-editor' ),
|
||||
array(
|
||||
'editor_script_handles' => 'contact-form-7-block-editor',
|
||||
)
|
||||
wpcf7_plugin_path( 'includes/block-editor' )
|
||||
);
|
||||
}
|
||||
|
||||
@@ -34,5 +34,5 @@
|
||||
"default": "form"
|
||||
}
|
||||
},
|
||||
"editorScript": "file:./index.js"
|
||||
"editorScript": [ "file:./index.js", "contact-form-7-block-editor" ]
|
||||
}
|
||||
|
||||
@@ -555,6 +555,28 @@ class WPCF7_ContactForm {
|
||||
|
||||
$this->unit_tag = self::generate_unit_tag( $this->id );
|
||||
|
||||
$action_url = wpcf7_get_request_uri();
|
||||
|
||||
if ( $frag = strstr( $action_url, '#' ) ) {
|
||||
$action_url = substr( $action_url, 0, -strlen( $frag ) );
|
||||
}
|
||||
|
||||
$action_url .= '#' . $this->unit_tag();
|
||||
|
||||
$action_url = apply_filters( 'wpcf7_form_action_url', $action_url );
|
||||
|
||||
if (
|
||||
str_starts_with( $action_url, '//' ) or
|
||||
! str_starts_with( $action_url, '/' ) and
|
||||
! str_starts_with( $action_url, home_url() )
|
||||
) {
|
||||
return sprintf(
|
||||
'<p class="wpcf7-invalid-action-url"><strong>%1$s</strong> %2$s</p>',
|
||||
esc_html( __( 'Error:', 'contact-form-7' ) ),
|
||||
esc_html( __( "Invalid action URL is detected.", 'contact-form-7' ) )
|
||||
);
|
||||
}
|
||||
|
||||
$lang_tag = str_replace( '_', '-', $this->locale );
|
||||
|
||||
if ( preg_match( '/^([a-z]+-[a-z]+)-/i', $lang_tag, $matches ) ) {
|
||||
@@ -573,16 +595,6 @@ class WPCF7_ContactForm {
|
||||
|
||||
$html .= "\n" . $this->screen_reader_response() . "\n";
|
||||
|
||||
$url = wpcf7_get_request_uri();
|
||||
|
||||
if ( $frag = strstr( $url, '#' ) ) {
|
||||
$url = substr( $url, 0, -strlen( $frag ) );
|
||||
}
|
||||
|
||||
$url .= '#' . $this->unit_tag();
|
||||
|
||||
$url = apply_filters( 'wpcf7_form_action_url', $url );
|
||||
|
||||
$id_attr = apply_filters( 'wpcf7_form_id_attr',
|
||||
preg_replace( '/[^A-Za-z0-9:._-]/', '', $args['html_id'] )
|
||||
);
|
||||
@@ -627,7 +639,7 @@ class WPCF7_ContactForm {
|
||||
$autocomplete = apply_filters( 'wpcf7_form_autocomplete', '' );
|
||||
|
||||
$atts = array(
|
||||
'action' => esc_url( $url ),
|
||||
'action' => esc_url( $action_url ),
|
||||
'method' => 'post',
|
||||
'class' => ( '' !== $class ) ? $class : null,
|
||||
'id' => ( '' !== $id_attr ) ? $id_attr : null,
|
||||
|
||||
@@ -271,6 +271,7 @@ function wpcf7_get_request_uri() {
|
||||
|
||||
if ( empty( $request_uri ) ) {
|
||||
$request_uri = add_query_arg( array() );
|
||||
$request_uri = '/' . ltrim( $request_uri, '/' );
|
||||
}
|
||||
|
||||
return sanitize_url( $request_uri );
|
||||
|
||||
@@ -5,7 +5,7 @@ Tags: contact form, schema-woven validation
|
||||
Requires at least: 6.3
|
||||
Requires PHP: 7.4
|
||||
Tested up to: 6.5
|
||||
Stable tag: 5.9.4
|
||||
Stable tag: 5.9.5
|
||||
License: GPLv2 or later
|
||||
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
@@ -78,6 +78,10 @@ Do you have questions or issues with Contact Form 7? Use these support channels
|
||||
|
||||
For more information, see [Releases](https://contactform7.com/category/releases/).
|
||||
|
||||
= 5.9.5 =
|
||||
|
||||
[https://contactform7.com/contact-form-7-595/](https://contactform7.com/contact-form-7-595/)
|
||||
|
||||
= 5.9.4 =
|
||||
|
||||
[https://contactform7.com/contact-form-7-594/](https://contactform7.com/contact-form-7-594/)
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
* Author URI: https://ideasilo.wordpress.com/
|
||||
* License: GPL v2 or later
|
||||
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
* Version: 5.9.4
|
||||
* Version: 5.9.5
|
||||
* Requires at least: 6.3
|
||||
* Requires PHP: 7.4
|
||||
*/
|
||||
|
||||
define( 'WPCF7_VERSION', '5.9.4' );
|
||||
define( 'WPCF7_VERSION', '5.9.5' );
|
||||
|
||||
define( 'WPCF7_REQUIRED_WP_VERSION', '6.3' );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user