File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -711,8 +711,20 @@ public function handle_frontend_submission() {
711711 check_ajax_referer ( 'wpuf_form_add ' );
712712 $ form_id = isset ( $ _POST ['form_id ' ] ) ? intval ( $ _POST ['form_id ' ] ) : 0 ;
713713 $ page_id = isset ( $ _POST ['page_id ' ] ) ? intval ( $ _POST ['page_id ' ] ) : 0 ;
714-
715714 $ form = weforms ()->form ->get ( $ form_id );
715+
716+ /**
717+ * Check if form submission is open. This resolves broken access control with unauthenticated users.
718+ * Access is now checked on frontend form rendering and submission.
719+ */
720+ $ form_submission_status = $ form ->is_submission_open ();
721+ if ( is_wp_error ( $ form_submission_status ) ) {
722+ wp_send_json ( [
723+ 'success ' => false ,
724+ 'error ' => __ ( 'Login Required for submission. ' , 'weforms ' ),
725+ ] );
726+ }
727+
716728 $ form_settings = $ form ->get_settings ();
717729 $ form_fields = $ form ->get_fields ();
718730 $ entry_fields = $ form ->prepare_entries ();
You can’t perform that action at this time.
0 commit comments