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
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/FormEntryMetaModel.php +27 -4 2.10.12.15.3 View file →
@@ -126,10 +126,9 @@
126 126 $value = $dbHelper->strValueModifyByLogic($condition->logic, $condition->val);
127 127 }
128 128
129 129 $operator = $dbHelper->convertToSqlOperator($condition->logic);
130 -
131 - if (isset($dateQuery[$condition->val])) {
130 + if (!is_array($condition->val) && isset($dateQuery[$condition->val])) {
132 131 $sql .= $dbHelper->fieldQueryByDate($condition->field, $operator, $value, $condition->logic);
133 132 } else {
134 133 if (!is_int($value)) {
135 134 $value = "'" . $value . "'";
@@ -394,8 +393,32 @@
394 393 ];
395 394 return $resultedEntries;
396 395 }
397 396
397 + public function getSingleEntryMeta($formFields, $entryId)
398 + {
399 + $entry_table = $this->app_db->prefix . 'bitforms_form_entries';
400 + $fieldCount = count($formFields);
401 + $getSelectedMetaFldValue = $this->selectedEntryMeta($formFields, $fieldCount);
402 + $selectedMeta = $getSelectedMetaFldValue['selected_meta'];
403 + $formFieldsNames = $getSelectedMetaFldValue['form_fields_names'];
404 + $all_values = $getSelectedMetaFldValue['all_values'];
405 + $condition['bitforms_form_entry_id'] = [$entryId];
406 + $group = $this->groupedCondition($condition, $all_values, []);
407 + $groupedCondition = $group['groupedCondition'];
408 + $all_values = $group['all_values'];
409 + $orderCondition = $this->orderCondition($formFieldsNames, null);
410 + $sql = "SELECT $selectedMeta FROM `$this->table_name` em";
411 + $sql .= " INNER JOIN $entry_table e on e.id = em.bitforms_form_entry_id ";
412 + $sql .= $groupedCondition . $orderCondition;
413 + $result = $this->execute($sql, $all_values)->getResult();
414 +
415 + if (is_wp_error($result)) {
416 + return [];
417 + }
418 + return $result;
419 + }
420 +
398 421 private function csvInjectionPrevent($value)
399 422 {
400 423 $formula = ['=', '-', '+', '@', "\t", "\r"];
401 424 $valueFilter = preg_replace('/[\]["]/i', '', $value);
@@ -468,9 +491,9 @@
468 491 $groupedCondition = $formattedCondition['conditions'] . ' GROUP BY
469 492 `bitforms_form_entry_id` ';
470 493 $all_values = array_merge($all_values, $formattedCondition['values']);
471 494 }
472 - $order = \is_null($sortBy) ? 'DESC ' : "$sortBy";
495 + $order = 'DESC' === $sortBy ? 'DESC ' : 'ASC ';
473 496 $orderField = \is_null($sortByField) ? 'bitforms_form_entry_id' : "`$sortByField`";
474 497
475 498 $orderCondition = "ORDER BY $orderField $order ";
476 499 if (!\is_null($limit)) {
@@ -494,9 +517,9 @@
494 517 $allData[$key]['entry_id'] = preg_replace('/[\]["]/i', '', $value->$entry_id);
495 518 if ('__user_id' === $formFieldName && intval($value->$formFieldName) > 0) {
496 519 $allData[$key][$formFieldName] = $userNames[$value->$formFieldName];
497 520 } elseif ('__user_ip' === $formFieldName) {
498 - $allData[$key][$formFieldName] = long2ip($value->$formFieldName);
521 + $allData[$key][$formFieldName] = long2ip((int)$value->$formFieldName);
499 522 } else {
500 523 $allData[$key][$formFieldName] = preg_replace('/[\]["]/i', '', $value->$formFieldName);
501 524 }
502 525 }