diff --git a/projects/packages/forms/changelog/fix-form-validation-with-js-disabled b/projects/packages/forms/changelog/fix-form-validation-with-js-disabled new file mode 100644 index 0000000000000..c62b7f9952d1a --- /dev/null +++ b/projects/packages/forms/changelog/fix-form-validation-with-js-disabled @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Forms: Fix 404 error when a user submits an invalid form with JavaScript disabled. diff --git a/projects/packages/forms/src/contact-form/class-contact-form.php b/projects/packages/forms/src/contact-form/class-contact-form.php index 5f51e6747390a..f649ea9c3e7b1 100644 --- a/projects/packages/forms/src/contact-form/class-contact-form.php +++ b/projects/packages/forms/src/contact-form/class-contact-form.php @@ -249,7 +249,7 @@ public static function style_on() { * @return string HTML for the concat form. */ public static function parse( $attributes, $content ) { - global $post, $page; // $page is used in the contact-form submission redirect + global $post, $page, $multipage; // $page is used in the contact-form submission redirect if ( Settings::is_syncing() ) { return ''; } @@ -346,7 +346,7 @@ public static function parse( $attributes, $content ) { } else { // Submit form to the post permalink $url = get_permalink(); - if ( $page ) { + if ( $multipage && $page ) { $url = add_query_arg( 'page', $page, $url ); } } diff --git a/projects/plugins/jetpack/changelog/fix-form-validation-with-js-disabled b/projects/plugins/jetpack/changelog/fix-form-validation-with-js-disabled new file mode 100644 index 0000000000000..7830d76e77574 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-form-validation-with-js-disabled @@ -0,0 +1,4 @@ +Significance: patch +Type: bugfix + +Forms: Fix 404 error when a user submits an invalid form with JavaScript disabled.