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 -22 6.256.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'];
@@ -114,20 +114,24 @@
114 114 * @return void
115 115 */
116 116 protected function init_include_fields( $atts ) {
117 117
118 - // For reverse compatibility with the fields parameter.
119 - if ( empty( $atts['include_fields'] ) && ! empty( $atts['fields'] ) ) {
120 - if ( ! is_array( $atts['fields'] ) ) {
121 - $atts['include_fields'] = $atts['fields'];
122 - } else {
123 - $atts['include_fields'] = '';
118 + // For reverse compatibility with the fields parameter
119 + if ( ! isset( $atts['include_fields'] ) || empty( $atts['include_fields'] ) ) {
124 120
125 - foreach ( $atts['fields'] as $included_field ) {
126 - $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'], ',' );
127 133 }
128 -
129 - $atts['include_fields'] = rtrim( $atts['include_fields'], ',' );
130 134 }
131 135 }
132 136
133 137 $this->include_fields = $this->prepare_array_property( 'include_fields', $atts );
@@ -171,14 +175,14 @@
171 175 *
172 176 * @since 2.04
173 177 *
174 178 * @param string $index
175 - * @param array $atts
179 + * @param array $atts
176 180 *
177 181 * @return array
178 182 */
179 183 private function prepare_array_property( $index, $atts ) {
180 - if ( ! empty( $atts[ $index ] ) ) {
184 + if ( isset( $atts[ $index ] ) && ! empty( $atts[ $index ] ) ) {
181 185
182 186 if ( is_array( $atts[ $index ] ) ) {
183 187 $property = $atts[ $index ];
184 188 } else {
@@ -261,19 +265,19 @@
261 265 'referrer' => '',
262 266 );
263 267 }
264 268
265 - $ip = array(
269 + $ip = array(
266 270 'label' => __( 'IP Address', 'formidable' ),
267 271 'value' => $this->entry->ip,
268 272 );
269 - $browser = array(
273 + $browser = array(
270 274 'label' => __( 'User-Agent (Browser/OS)', 'formidable' ),
271 275 'value' => isset( $entry_description['browser'] ) ? FrmEntriesHelper::get_browser( $entry_description['browser'] ) : '',
272 276 );
273 277 $referrer = array(
274 278 'label' => __( 'Referrer', 'formidable' ),
275 - 'value' => $entry_description['referrer'] ?? '',
279 + 'value' => isset( $entry_description['referrer'] ) ? $entry_description['referrer'] : '',
276 280 );
277 281
278 282 /**
279 283 * Allow the referrer to be modified.
@@ -279,11 +283,10 @@
279 283 * Allow the referrer to be modified.
280 284 *
281 285 * @since 5.5.1
282 286 *
283 - * @param array $referrer
284 - * @param array $entry_description
285 - * @param object $entry
287 + * @param array $referrer
288 + * @param array @entry_description
286 289 */
287 290 $referrer = apply_filters( 'frm_user_info_referrer', $referrer, $entry_description, $this->entry );
288 291
289 292 $this->user_info = array(
@@ -334,9 +337,9 @@
334 337 *
335 338 * @since 2.04
336 339 *
337 340 * @param stdClass $field
338 - * @param array $array
341 + * @param array $array
339 342 *
340 343 * @return bool
341 344 */
342 345 protected function is_field_in_array( $field, $array ) {