PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.15.3
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.15.3
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
← All changes | includes/Frontend/FormEntryView.php +5 -14 3.2.22.15.3 View file →
@@ -8,22 +8,14 @@
8 8 class FormEntryView
9 9 {
10 10 public static function preview()
11 11 {
12 - if (!(current_user_can('manage_options') || current_user_can('manage_bitform') || current_user_can('bitform_entry_edit'))) {
13 - auth_redirect();
14 - return;
15 - }
16 - // Read-only: REQUEST_URI and query params used for view dispatch. Capability check enforced above (line 12).
17 - $requestUri = isset($_SERVER['REQUEST_URI']) ? esc_url_raw(wp_unslash($_SERVER['REQUEST_URI'])) : '';
12 + $requestUri = $_SERVER['REQUEST_URI'];
18 13 $uri = explode('/', $requestUri);
19 14
20 - $formID = isset($_REQUEST['formId']) ? intval(sanitize_text_field(wp_unslash($_REQUEST['formId']))) : null;
21 - $entryID = isset($_REQUEST['entryId']) ? intval(sanitize_text_field(wp_unslash($_REQUEST['entryId']))) : null;
22 -
23 - if (!is_array($formID) && !is_array($entryID) && is_numeric($formID) && is_numeric($entryID)) {
24 - // $formID = $uri[count($uri) - 2];
25 - // $entryID = $uri[count($uri) - 1];
15 + if (is_array($uri) && count($uri) > 0) {
16 + $formID = $uri[count($uri) - 2];
17 + $entryID = $uri[count($uri) - 1];
26 18 $attr = ['form_id' => $formID, 'entry_id' => $entryID, 'form_preview' => true];
27 19
28 20 $frontendFormHandler = new FrontendFormHandler();
29 21 $formViewObject = $frontendFormHandler->handleFrontendRenderRequest($attr);
@@ -34,13 +26,12 @@
34 26
35 27 $formHTML = $formViewObject->html;
36 28 $font = $formViewObject->font;
37 29 $bfGlobals = $formViewObject->bfGlobals;
38 - $formContent = isset($formViewObject->formContent) ? $formViewObject->formContent : null;
39 30
40 31 set_transient('bitform_form_preview', true);
41 32 $frontendFormHandler->generateJs($formID, $entryID);
42 33 $title = 'BitForm Entry edit';
43 - Render::view('views/entry-edit-page', compact('formID', 'title', 'formHTML', 'font', 'bfGlobals', 'formContent'));
34 + Render::view('views/entry-edit-page', compact('formID', 'title', 'formHTML', 'font', 'bfGlobals'));
44 35 }
45 36 }
46 37 }