PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.2
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.2
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/models/FrmEntryValues.php +25 -25 6.266.2 View file →
@@ -8,11 +8,11 @@
8 8 */
9 9 class FrmEntryValues {
10 10
11 11 /**
12 - * @var stdClass|null
12 + * @var stdClass
13 13 */
14 - protected $entry;
14 + protected $entry = null;
15 15
16 16 /**
17 17 * @var int
18 18 */
@@ -48,9 +48,9 @@
48 48 *
49 49 * @since 2.04
50 50 *
51 51 * @param int|string $entry_id
52 - * @param array $atts
52 + * @param array $atts
53 53 */
54 54 public function __construct( $entry_id, $atts = array() ) {
55 55 if ( isset( $atts['entry'] ) && is_object( $atts['entry'] ) && ! empty( $atts['entry']->metas ) ) {
56 56 $this->entry = $atts['entry'];
@@ -86,9 +86,8 @@
86 86 /**
87 87 * Gets entry property.
88 88 *
89 89 * @since 5.0.16
90 - *
91 90 * @return stdClass
92 91 */
93 92 public function get_entry() {
94 93 return $this->entry;
@@ -115,20 +114,24 @@
115 114 * @return void
116 115 */
117 116 protected function init_include_fields( $atts ) {
118 117
119 - // For reverse compatibility with the fields parameter.
120 - if ( empty( $atts['include_fields'] ) && ! empty( $atts['fields'] ) ) {
121 - if ( ! is_array( $atts['fields'] ) ) {
122 - $atts['include_fields'] = $atts['fields'];
123 - } else {
124 - $atts['include_fields'] = '';
118 + // For reverse compatibility with the fields parameter
119 + if ( ! isset( $atts['include_fields'] ) || empty( $atts['include_fields'] ) ) {
125 120
126 - foreach ( $atts['fields'] as $included_field ) {
127 - $atts['include_fields'] .= $included_field->id . ',';
121 + if ( isset( $atts['fields'] ) && ! empty( $atts['fields'] ) ) {
122 +
123 + if ( ! is_array( $atts['fields'] ) ) {
124 + $atts['include_fields'] = $atts['fields'];
125 + } else {
126 + $atts['include_fields'] = '';
127 +
128 + foreach ( $atts['fields'] as $included_field ) {
129 + $atts['include_fields'] .= $included_field->id . ',';
130 + }
131 +
132 + $atts['include_fields'] = rtrim( $atts['include_fields'], ',' );
128 133 }
129 -
130 - $atts['include_fields'] = rtrim( $atts['include_fields'], ',' );
131 134 }
132 135 }
133 136
134 137 $this->include_fields = $this->prepare_array_property( 'include_fields', $atts );
@@ -172,14 +175,14 @@
172 175 *
173 176 * @since 2.04
174 177 *
175 178 * @param string $index
176 - * @param array $atts
179 + * @param array $atts
177 180 *
178 181 * @return array
179 182 */
180 183 private function prepare_array_property( $index, $atts ) {
181 - if ( ! empty( $atts[ $index ] ) ) {
184 + if ( isset( $atts[ $index ] ) && ! empty( $atts[ $index ] ) ) {
182 185
183 186 if ( is_array( $atts[ $index ] ) ) {
184 187 $property = $atts[ $index ];
185 188 } else {
@@ -262,19 +265,19 @@
262 265 'referrer' => '',
263 266 );
264 267 }
265 268
266 - $ip = array(
269 + $ip = array(
267 270 'label' => __( 'IP Address', 'formidable' ),
268 271 'value' => $this->entry->ip,
269 272 );
270 - $browser = array(
273 + $browser = array(
271 274 'label' => __( 'User-Agent (Browser/OS)', 'formidable' ),
272 275 'value' => isset( $entry_description['browser'] ) ? FrmEntriesHelper::get_browser( $entry_description['browser'] ) : '',
273 276 );
274 277 $referrer = array(
275 278 'label' => __( 'Referrer', 'formidable' ),
276 - 'value' => $entry_description['referrer'] ?? '',
279 + 'value' => isset( $entry_description['referrer'] ) ? $entry_description['referrer'] : '',
277 280 );
278 281
279 282 /**
280 283 * Allow the referrer to be modified.
@@ -280,11 +283,10 @@
280 283 * Allow the referrer to be modified.
281 284 *
282 285 * @since 5.5.1
283 286 *
284 - * @param array $referrer
285 - * @param array $entry_description
286 - * @param object $entry
287 + * @param array $referrer
288 + * @param array @entry_description
287 289 */
288 290 $referrer = apply_filters( 'frm_user_info_referrer', $referrer, $entry_description, $this->entry );
289 291
290 292 $this->user_info = array(
@@ -315,9 +317,8 @@
315 317 * @return bool
316 318 */
317 319 protected function is_field_included( $field ) {
318 320 $is_included = true;
319 -
320 321 if ( ! empty( $this->include_fields ) ) {
321 322 $is_included = $this->is_field_in_array( $field, $this->include_fields );
322 323 }
323 324
@@ -322,9 +323,8 @@
322 323 }
323 324
324 325 if ( ! empty( $this->exclude_fields ) ) {
325 326 $is_excluded = $this->is_field_in_array( $field, $this->exclude_fields );
326 -
327 327 if ( $is_excluded ) {
328 328 $is_included = false;
329 329 }
330 330 }
@@ -337,9 +337,9 @@
337 337 *
338 338 * @since 2.04
339 339 *
340 340 * @param stdClass $field
341 - * @param array $array
341 + * @param array $array
342 342 *
343 343 * @return bool
344 344 */
345 345 protected function is_field_in_array( $field, $array ) {