PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.16.2
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.16.2
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 2.10.2 All 137 releases
← All changes | includes/Core/Database/FormEntryLogModel.php +13 -11 2.10.22.16.2 View file →
@@ -13,15 +13,14 @@
13 13 protected static $table = 'bitforms_form_log_details';
14 14
15 15 public function geLogHistory($form_id, $entry_id)
16 16 {
17 - $sql = "SELECT * FROM `{$this->app_db->prefix}bitforms_form_entry_log` where form_entry_id=$entry_id AND form_id=$form_id order By created_at DESC";
18 -
19 - $logs = $this->execute($sql)->getResult();
17 + $sql = "SELECT * FROM `{$this->app_db->prefix}bitforms_form_entry_log` where form_entry_id=%d AND form_id=%d order By created_at DESC";
18 + $logs = $this->execute($sql, [$entry_id, $form_id])->getResult();
20 19 $response = ['success' => true, 'data' => [], 'integrations' => []];
21 20 $ids = [];
22 21 foreach ($logs as $log) {
23 - $ids[] = $log->id;
22 + $ids[] = (int) $log->id;
24 23 }
25 24 if (isset($logs->errors['result_empty'])) {
26 25 wp_send_json($response);
27 26 } else {
@@ -27,18 +26,21 @@
27 26 } else {
28 27 $allLogId = preg_replace('/"/', '', implode(',', $ids));
29 28 $sql2 = "SELECT * FROM `{$this->app_db->prefix}bitforms_form_log_details` WHERE `log_id` IN ($allLogId)";
30 29 $integrations = $this->execute($sql2)->getResult();
31 - foreach ($logs as $key => $log) {
32 - foreach ($integrations as $integration) {
33 - if ($integration->log_id === $log->id) {
34 - $logs[$key]->integration = true;
30 +
31 + if (isset($integrations->errors['result_empty'])) {
32 + $integrations = [];
33 + } else {
34 + foreach ($logs as $key => $log) {
35 + foreach ($integrations as $integration) {
36 + if ($integration->log_id === $log->id) {
37 + $logs[$key]->integration = true;
38 + }
35 39 }
36 40 }
37 41 }
38 - if (isset($integrations->errors['result_empty'])) {
39 - $integrations = [];
40 - }
42 +
41 43 wp_send_json(['success' => true, 'data' => $logs, 'integrations' => $integrations]);
42 44 }
43 45 }
44 46