PluginProbe
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment / 2.1.22
FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment v2.1.22
3.1.13 3.1.12 3.1.11 3.1.10 3.1.9 3.1.8 3.1.7 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 All 122 releases
← All changes | Inc/Core/Controllers/Submissions.php +15 -20 trunk2.1.22 View file →
@@ -1,12 +1,12 @@
1 1 <?php
2 2 /**
3 3 * @package FireBox
4 - * @version 3.1.13 Free
4 + * @version 2.1.22 Free
5 5 *
6 6 * @author FirePlugins <info@fireplugins.com>
7 7 * @link https://www.fireplugins.com
8 - * @copyright Copyright © 2026 FirePlugins All Rights Reserved
8 + * @copyright Copyright © 2024 FirePlugins All Rights Reserved
9 9 * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
10 10 */
11 11
12 12 namespace FireBox\Core\Controllers;
@@ -89,9 +89,9 @@
89 89 {
90 90 $this->list();
91 91 return;
92 92 }
93 -
93 +
94 94 $html = firebox()->renderer->admin->render('pages/submissions/edit', [
95 95 'submission' => $submission
96 96 ], true);
97 97
@@ -99,9 +99,9 @@
99 99 'section_name' => self::settings_name,
100 100 'button_label' => firebox()->_('FB_UPDATE_SUBMISSION')
101 101 ]);
102 102
103 - echo $form->render(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
103 + echo $form->render();
104 104 }
105 105
106 106 /**
107 107 * Returns current task.
@@ -149,17 +149,13 @@
149 149 {
150 150 return;
151 151 }
152 152
153 - // Sanitize
154 - $submission_id = absint($data['submission_id']);
155 - $form_id = sanitize_key($data['form_id']);
156 -
157 153 // Ensure a submission record with given Submission ID and Form ID exist
158 154 $payload = [
159 155 'where' => [
160 - 'id' => ' = ' . $submission_id,
161 - 'form_id' => ' = "' . $form_id . '"'
156 + 'id' => ' = ' . esc_sql($data['submission_id']),
157 + 'form_id' => ' = "' . esc_sql($data['form_id']) . '"'
162 158 ]
163 159 ];
164 160 if (!firebox()->tables->submission->getResults($payload, true, true))
165 161 {
@@ -166,9 +162,9 @@
166 162 return;
167 163 }
168 164
169 165 // Get Form
170 - if (!$form = Form::getFormByID($form_id))
166 + if (!$form = Form::getFormByID($data['form_id']))
171 167 {
172 168 return;
173 169 }
174 170
@@ -173,11 +169,11 @@
173 169 }
174 170
175 171 $controller_settings = $data[self::settings_name];
176 172 $form_fields = $form['fields'];
177 - $fields_values = is_array($data['fb_form']) ? $data['fb_form'] : [];
173 + $fields_values = $data['fb_form'];
178 174 $submission_state = isset($controller_settings['submission_state']) ? $controller_settings['submission_state'] : 'published';
179 -
175 +
180 176 // Make the form fields not required
181 177 foreach ($form_fields as $key => $field)
182 178 {
183 179 $field->setOptionValue('required', false);
@@ -202,22 +198,21 @@
202 198 'modified_at' => gmdate('Y-m-d H:i:s'),
203 199 'state' => $submission_state === 'published' ? 1 : 0
204 200 ];
205 201 $where = [
206 - 'id' => $submission_id,
207 - 'form_id' => $form_id
202 + 'id' => $data['submission_id'],
203 + 'form_id' => $data['form_id']
208 204 ];
209 205 firebox()->tables->submission->update($replace, $where);
210 206
211 207 // Update submission meta for each field
212 - foreach ((is_array($valid) ? $valid : []) as $key => $field)
208 + foreach ($valid as $key => $field)
213 209 {
214 - $field_name = $field->getOptionValue('name');
215 - $meta_value = isset($fields_values[$field_name]) ? $fields_values[$field_name] : '';
210 + $meta_value = $fields_values[$field->getOptionValue('name')];
216 211
217 212 if (is_array($meta_value))
218 213 {
219 - $meta_value = wp_json_encode($meta_value);
214 + $meta_value = json_encode($meta_value);
220 215 }
221 216
222 217 $replace = [
223 218 'meta_value' => $meta_value,
@@ -223,9 +218,9 @@
223 218 'meta_value' => $meta_value,
224 219 'modified_at' => gmdate('Y-m-d H:i:s')
225 220 ];
226 221 $where = [
227 - 'submission_id' => $submission_id,
222 + 'submission_id' => $data['submission_id'],
228 223 'meta_key' => $field->getOptionValue('id')
229 224 ];
230 225
231 226 $updated = firebox()->tables->submissionmeta->update($replace, $where);