@@ -65,12 +65,12 @@ |
||
65 | 65 | $string->read( 1 ); |
66 | 66 | |
67 | 67 | $val = array(); |
68 | - for ( $i = 0; $i < $count; $i++ ) { |
|
68 | + for ( $i = 0; $i < $count; $i ++ ) { |
|
69 | 69 | $array_key = $this->do_parse( $string ); |
70 | 70 | $array_value = $this->do_parse( $string ); |
71 | 71 | |
72 | 72 | if ( ! is_array( $array_key ) ) { |
73 | - $val[ $array_key ] = $array_value; |
|
73 | + $val[$array_key] = $array_value; |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 |
@@ -240,26 +240,26 @@ discard block |
||
240 | 240 | public static function populate_on_submit_data( &$form_options, $action = null, $event = 'create' ) { |
241 | 241 | $opt = 'update' === $event ? 'edit_' : 'success_'; |
242 | 242 | if ( ! $action || ! is_object( $action ) ) { |
243 | - $form_options[ $opt . 'action' ] = self::get_default_action_type(); |
|
244 | - $form_options[ $opt . 'msg' ] = self::get_default_msg(); |
|
243 | + $form_options[$opt . 'action'] = self::get_default_action_type(); |
|
244 | + $form_options[$opt . 'msg'] = self::get_default_msg(); |
|
245 | 245 | |
246 | 246 | return; |
247 | 247 | } |
248 | 248 | |
249 | - $form_options[ $opt . 'action' ] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message'; |
|
249 | + $form_options[$opt . 'action'] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message'; |
|
250 | 250 | |
251 | - switch ( $form_options[ $opt . 'action' ] ) { |
|
251 | + switch ( $form_options[$opt . 'action'] ) { |
|
252 | 252 | case 'redirect': |
253 | - $form_options[ $opt . 'url' ] = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : ''; |
|
253 | + $form_options[$opt . 'url'] = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : ''; |
|
254 | 254 | $form_options['open_in_new_tab'] = ! empty( $action->post_content['open_in_new_tab'] ); |
255 | 255 | break; |
256 | 256 | |
257 | 257 | case 'page': |
258 | - $form_options[ $opt . 'page_id' ] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : ''; |
|
258 | + $form_options[$opt . 'page_id'] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : ''; |
|
259 | 259 | break; |
260 | 260 | |
261 | 261 | default: |
262 | - $form_options[ $opt . 'msg' ] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg(); |
|
262 | + $form_options[$opt . 'msg'] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg(); |
|
263 | 263 | $form_options['show_form'] = ! empty( $action->post_content['show_form'] ); |
264 | 264 | } |
265 | 265 | } |
@@ -348,20 +348,20 @@ discard block |
||
348 | 348 | private static function get_on_submit_action_data_from_form_options( $form_options, $event = 'create' ) { |
349 | 349 | $opt = 'update' === $event ? 'edit_' : 'success_'; |
350 | 350 | $data = array( |
351 | - 'success_action' => isset( $form_options[ $opt . 'action' ] ) ? $form_options[ $opt . 'action' ] : self::get_default_action_type(), |
|
351 | + 'success_action' => isset( $form_options[$opt . 'action'] ) ? $form_options[$opt . 'action'] : self::get_default_action_type(), |
|
352 | 352 | ); |
353 | 353 | |
354 | 354 | switch ( $data['success_action'] ) { |
355 | 355 | case 'redirect': |
356 | - $data['success_url'] = isset( $form_options[ $opt . 'url' ] ) ? $form_options[ $opt . 'url' ] : ''; |
|
356 | + $data['success_url'] = isset( $form_options[$opt . 'url'] ) ? $form_options[$opt . 'url'] : ''; |
|
357 | 357 | break; |
358 | 358 | |
359 | 359 | case 'page': |
360 | - $data['success_page_id'] = isset( $form_options[ $opt . 'page_id' ] ) ? $form_options[ $opt . 'page_id' ] : ''; |
|
360 | + $data['success_page_id'] = isset( $form_options[$opt . 'page_id'] ) ? $form_options[$opt . 'page_id'] : ''; |
|
361 | 361 | break; |
362 | 362 | |
363 | 363 | default: |
364 | - $data['success_msg'] = isset( $form_options[ $opt . 'msg' ] ) ? $form_options[ $opt . 'msg' ] : self::get_default_msg(); |
|
364 | + $data['success_msg'] = isset( $form_options[$opt . 'msg'] ) ? $form_options[$opt . 'msg'] : self::get_default_msg(); |
|
365 | 365 | $data['show_form'] = ! empty( $form_options['show_form'] ); |
366 | 366 | } |
367 | 367 |
@@ -1708,7 +1708,8 @@ discard block |
||
1708 | 1708 | $vars = array(); |
1709 | 1709 | FrmAppHelper::include_svg(); |
1710 | 1710 | |
1711 | - if ( isset( $_POST['frm_compact_fields'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1711 | + if ( isset( $_POST['frm_compact_fields'] ) ) { |
|
1712 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
1712 | 1713 | FrmAppHelper::permission_check( 'frm_edit_forms' ); |
1713 | 1714 | |
1714 | 1715 | // Javascript needs to be allowed in some field settings. |
@@ -2018,7 +2019,8 @@ discard block |
||
2018 | 2019 | private static function maybe_get_form_to_show( $id ) { |
2019 | 2020 | $form = false; |
2020 | 2021 | |
2021 | - if ( ! empty( $id ) ) { // form id or key is set |
|
2022 | + if ( ! empty( $id ) ) { |
|
2023 | +// form id or key is set |
|
2022 | 2024 | $form = FrmForm::getOne( $id ); |
2023 | 2025 | if ( ! $form || $form->parent_form_id || $form->status === 'trash' ) { |
2024 | 2026 | $form = false; |
@@ -2103,7 +2105,8 @@ discard block |
||
2103 | 2105 | private static function get_saved_errors( $form, $params ) { |
2104 | 2106 | global $frm_vars; |
2105 | 2107 | |
2106 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2108 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { |
|
2109 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2107 | 2110 | $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
2108 | 2111 | } else { |
2109 | 2112 | $errors = array(); |
@@ -2294,7 +2297,8 @@ discard block |
||
2294 | 2297 | $action_type = FrmOnSubmitHelper::get_action_type( $action ); |
2295 | 2298 | |
2296 | 2299 | if ( 'redirect' === $action_type ) { |
2297 | - if ( $has_redirect ) { // Do not process because we run the first redirect action only. |
|
2300 | + if ( $has_redirect ) { |
|
2301 | +// Do not process because we run the first redirect action only. |
|
2298 | 2302 | continue; |
2299 | 2303 | } |
2300 | 2304 | } |
@@ -2523,12 +2527,14 @@ discard block |
||
2523 | 2527 | |
2524 | 2528 | $doing_ajax = FrmAppHelper::doing_ajax(); |
2525 | 2529 | |
2526 | - if ( ! empty( $args['ajax'] ) && $doing_ajax && empty( $args['force_delay_redirect'] ) ) { // Is AJAX submit and there is just one Redirect action runs. |
|
2530 | + if ( ! empty( $args['ajax'] ) && $doing_ajax && empty( $args['force_delay_redirect'] ) ) { |
|
2531 | +// Is AJAX submit and there is just one Redirect action runs. |
|
2527 | 2532 | echo json_encode( self::get_ajax_redirect_response_data( $args + compact( 'success_url' ) ) ); |
2528 | 2533 | wp_die(); |
2529 | 2534 | } |
2530 | 2535 | |
2531 | - if ( ! headers_sent() && empty( $args['force_delay_redirect'] ) ) { // Not AJAX submit, no headers sent, and there is just one Redirect action runs. |
|
2536 | + if ( ! headers_sent() && empty( $args['force_delay_redirect'] ) ) { |
|
2537 | +// Not AJAX submit, no headers sent, and there is just one Redirect action runs. |
|
2532 | 2538 | if ( ! empty( $args['form']->options['open_in_new_tab'] ) ) { |
2533 | 2539 | self::print_open_in_new_tab_js_with_fallback_handler( $success_url, $args ); |
2534 | 2540 | self::$redirected_in_new_tab[ $args['form']->id ] = 1; |
@@ -2628,7 +2634,8 @@ discard block |
||
2628 | 2634 | |
2629 | 2635 | echo FrmAppHelper::maybe_kses( $redirect_msg ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
2630 | 2636 | echo '<script>'; |
2631 | - if ( empty( $args['doing_ajax'] ) ) { // Not AJAX submit, delay JS until window.load. |
|
2637 | + if ( empty( $args['doing_ajax'] ) ) { |
|
2638 | +// Not AJAX submit, delay JS until window.load. |
|
2632 | 2639 | echo 'window.onload=function(){'; |
2633 | 2640 | } |
2634 | 2641 | echo 'setTimeout(function(){' . $redirect_js . '}, ' . intval( $delay_time ) . ');'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
@@ -546,11 +546,11 @@ discard block |
||
546 | 546 | ), |
547 | 547 | ); |
548 | 548 | |
549 | - if ( ! isset( $available_status[ $status ] ) ) { |
|
549 | + if ( ! isset( $available_status[$status] ) ) { |
|
550 | 550 | return; |
551 | 551 | } |
552 | 552 | |
553 | - FrmAppHelper::permission_check( $available_status[ $status ]['permission'] ); |
|
553 | + FrmAppHelper::permission_check( $available_status[$status]['permission'] ); |
|
554 | 554 | |
555 | 555 | $params = FrmForm::list_page_params(); |
556 | 556 | |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | check_admin_referer( $status . '_form_' . $params['id'] ); |
559 | 559 | |
560 | 560 | $count = 0; |
561 | - if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) { |
|
561 | + if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) { |
|
562 | 562 | $count ++; |
563 | 563 | } |
564 | 564 | |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
576 | 576 | $available_status['trash']['message'] = sprintf( _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, '<a href="' . esc_url( wp_nonce_url( '?page=formidable&frm_action=untrash&form_type=' . $form_type . '&id=' . $params['id'], 'untrash_form_' . $params['id'] ) ) . '">', '</a>' ); |
577 | 577 | |
578 | - $message = $available_status[ $status ]['message']; |
|
578 | + $message = $available_status[$status]['message']; |
|
579 | 579 | |
580 | 580 | self::display_forms_list( $params, $message ); |
581 | 581 | } |
@@ -596,7 +596,7 @@ discard block |
||
596 | 596 | 'type' => 'request', |
597 | 597 | ) |
598 | 598 | ); |
599 | - $message = sprintf( |
|
599 | + $message = sprintf( |
|
600 | 600 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
601 | 601 | _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), |
602 | 602 | $count, |
@@ -1145,7 +1145,7 @@ discard block |
||
1145 | 1145 | |
1146 | 1146 | foreach ( array( 'landing', 'chat', 'abandonment' ) as $feature ) { |
1147 | 1147 | if ( ! FrmAppHelper::show_new_feature( $feature ) ) { |
1148 | - unset( $sections[ $feature ] ); |
|
1148 | + unset( $sections[$feature] ); |
|
1149 | 1149 | } |
1150 | 1150 | } |
1151 | 1151 | |
@@ -1178,7 +1178,7 @@ discard block |
||
1178 | 1178 | $section['id'] = $section['anchor']; |
1179 | 1179 | } |
1180 | 1180 | |
1181 | - $sections[ $key ] = $section; |
|
1181 | + $sections[$key] = $section; |
|
1182 | 1182 | } |
1183 | 1183 | |
1184 | 1184 | return $sections; |
@@ -1296,7 +1296,7 @@ discard block |
||
1296 | 1296 | if ( ! empty( $user_fields ) ) { |
1297 | 1297 | $user_helpers = array(); |
1298 | 1298 | foreach ( $user_fields as $uk => $uf ) { |
1299 | - $user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf; |
|
1299 | + $user_helpers['|user_id| show="' . $uk . '"'] = $uf; |
|
1300 | 1300 | unset( $uk, $uf ); |
1301 | 1301 | } |
1302 | 1302 | |
@@ -1435,7 +1435,7 @@ discard block |
||
1435 | 1435 | if ( ! isset( $frm_vars['js_validate_forms'] ) ) { |
1436 | 1436 | $frm_vars['js_validate_forms'] = array(); |
1437 | 1437 | } |
1438 | - $frm_vars['js_validate_forms'][ $form->id ] = $form; |
|
1438 | + $frm_vars['js_validate_forms'][$form->id] = $form; |
|
1439 | 1439 | } |
1440 | 1440 | |
1441 | 1441 | public static function get_email_html() { |
@@ -1594,7 +1594,7 @@ discard block |
||
1594 | 1594 | add_filter( 'frm_validate_form', 'FrmFormsController::json_error' ); |
1595 | 1595 | } else { |
1596 | 1596 | $vars = FrmAppHelper::json_to_array( $json_vars ); |
1597 | - $action = $vars[ $action ]; |
|
1597 | + $action = $vars[$action]; |
|
1598 | 1598 | unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
1599 | 1599 | $_REQUEST = array_merge( $_REQUEST, $vars ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
1600 | 1600 | $_POST = array_merge( $_POST, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
@@ -1753,7 +1753,7 @@ discard block |
||
1753 | 1753 | $actions = array(); |
1754 | 1754 | foreach ( $frm_vars['forms_loaded'] as $form ) { |
1755 | 1755 | if ( is_object( $form ) ) { |
1756 | - $actions[ $form->id ] = $form->name; |
|
1756 | + $actions[$form->id] = $form->name; |
|
1757 | 1757 | } |
1758 | 1758 | unset( $form ); |
1759 | 1759 | } |
@@ -1997,8 +1997,8 @@ discard block |
||
1997 | 1997 | private static function get_saved_errors( $form, $params ) { |
1998 | 1998 | global $frm_vars; |
1999 | 1999 | |
2000 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2001 | - $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
|
2000 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
2001 | + $errors = $frm_vars['created_entries'][$form->id]['errors']; |
|
2002 | 2002 | } else { |
2003 | 2003 | $errors = array(); |
2004 | 2004 | } |
@@ -2020,7 +2020,7 @@ discard block |
||
2020 | 2020 | public static function just_created_entry( $form_id ) { |
2021 | 2021 | global $frm_vars; |
2022 | 2022 | |
2023 | - return ( isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][ $form_id ] ) && isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ) ? $frm_vars['created_entries'][ $form_id ]['entry_id'] : 0; |
|
2023 | + return ( isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][$form_id] ) && isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ) ? $frm_vars['created_entries'][$form_id]['entry_id'] : 0; |
|
2024 | 2024 | } |
2025 | 2025 | |
2026 | 2026 | /** |
@@ -2040,7 +2040,7 @@ discard block |
||
2040 | 2040 | private static function get_confirmation_method( $atts ) { |
2041 | 2041 | $action = FrmOnSubmitHelper::current_event( $atts ); |
2042 | 2042 | $opt = 'update' === $action ? 'edit_action' : 'success_action'; |
2043 | - $method = ( isset( $atts['form']->options[ $opt ] ) && ! empty( $atts['form']->options[ $opt ] ) ) ? $atts['form']->options[ $opt ] : 'message'; |
|
2043 | + $method = ( isset( $atts['form']->options[$opt] ) && ! empty( $atts['form']->options[$opt] ) ) ? $atts['form']->options[$opt] : 'message'; |
|
2044 | 2044 | |
2045 | 2045 | if ( ! empty( $atts['entry_id'] ) ) { |
2046 | 2046 | $met_actions = self::get_met_on_submit_actions( $atts, $action ); |
@@ -2061,7 +2061,7 @@ discard block |
||
2061 | 2061 | public static function maybe_trigger_redirect( $form, $params, $args ) { |
2062 | 2062 | if ( ! isset( $params['id'] ) ) { |
2063 | 2063 | global $frm_vars; |
2064 | - $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id']; |
|
2064 | + $params['id'] = $frm_vars['created_entries'][$form->id]['entry_id']; |
|
2065 | 2065 | } |
2066 | 2066 | |
2067 | 2067 | $conf_method = self::get_confirmation_method( |
@@ -2143,7 +2143,7 @@ discard block |
||
2143 | 2143 | $args['success_opt'] = $opt; |
2144 | 2144 | $args['ajax'] = ! empty( $frm_vars['ajax'] ); |
2145 | 2145 | |
2146 | - if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) { |
|
2146 | + if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) { |
|
2147 | 2147 | self::load_page_after_submit( $args ); |
2148 | 2148 | } elseif ( $args['conf_method'] === 'redirect' ) { |
2149 | 2149 | self::redirect_after_submit( $args ); |
@@ -2167,7 +2167,7 @@ discard block |
||
2167 | 2167 | } |
2168 | 2168 | |
2169 | 2169 | // If a redirect action has already opened the URL in a new tab, we show the default message in the currect tab. |
2170 | - if ( ! empty( self::$redirected_in_new_tab[ $args['form']->id ] ) ) { |
|
2170 | + if ( ! empty( self::$redirected_in_new_tab[$args['form']->id] ) ) { |
|
2171 | 2171 | return array( FrmOnSubmitHelper::get_fallback_action_after_open_in_new_tab( $event ) ); |
2172 | 2172 | } |
2173 | 2173 | |
@@ -2354,7 +2354,7 @@ discard block |
||
2354 | 2354 | |
2355 | 2355 | $opt = 'update' === $args['action'] ? 'edit_' : 'success_'; |
2356 | 2356 | |
2357 | - $new_args['conf_method'] = $new_args['form']->options[ $opt . 'action' ]; |
|
2357 | + $new_args['conf_method'] = $new_args['form']->options[$opt . 'action']; |
|
2358 | 2358 | |
2359 | 2359 | /** |
2360 | 2360 | * Filters the run success action args. |
@@ -2374,8 +2374,8 @@ discard block |
||
2374 | 2374 | private static function load_page_after_submit( $args ) { |
2375 | 2375 | global $post; |
2376 | 2376 | $opt = $args['success_opt']; |
2377 | - if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) { |
|
2378 | - $page = get_post( $args['form']->options[ $opt . '_page_id' ] ); |
|
2377 | + if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) { |
|
2378 | + $page = get_post( $args['form']->options[$opt . '_page_id'] ); |
|
2379 | 2379 | $old_post = $post; |
2380 | 2380 | $post = $page; |
2381 | 2381 | $content = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] ); |
@@ -2405,7 +2405,7 @@ discard block |
||
2405 | 2405 | add_filter( 'frm_use_wpautop', '__return_false' ); |
2406 | 2406 | |
2407 | 2407 | $opt = $args['success_opt']; |
2408 | - $success_url = trim( $args['form']->options[ $opt . '_url' ] ); |
|
2408 | + $success_url = trim( $args['form']->options[$opt . '_url'] ); |
|
2409 | 2409 | $success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] ); |
2410 | 2410 | $success_url = do_shortcode( $success_url ); |
2411 | 2411 | |
@@ -2425,7 +2425,7 @@ discard block |
||
2425 | 2425 | if ( ! headers_sent() && empty( $args['force_delay_redirect'] ) ) { // Not AJAX submit, no headers sent, and there is just one Redirect action runs. |
2426 | 2426 | if ( ! empty( $args['form']->options['open_in_new_tab'] ) ) { |
2427 | 2427 | self::print_open_in_new_tab_js_with_fallback_handler( $success_url, $args ); |
2428 | - self::$redirected_in_new_tab[ $args['form']->id ] = 1; |
|
2428 | + self::$redirected_in_new_tab[$args['form']->id] = 1; |
|
2429 | 2429 | return; |
2430 | 2430 | } |
2431 | 2431 | |
@@ -2685,7 +2685,7 @@ discard block |
||
2685 | 2685 | 'description' => false, |
2686 | 2686 | 'reset' => false, |
2687 | 2687 | ); |
2688 | - $args = wp_parse_args( $args, $defaults ); |
|
2688 | + $args = wp_parse_args( $args, $defaults ); |
|
2689 | 2689 | } |
2690 | 2690 | |
2691 | 2691 | /** |
@@ -2723,7 +2723,7 @@ discard block |
||
2723 | 2723 | $opt = isset( $args['success_opt'] ) ? $args['success_opt'] : 'success'; |
2724 | 2724 | |
2725 | 2725 | if ( $entry_id && is_numeric( $entry_id ) ) { |
2726 | - $message = isset( $form->options[ $opt . '_msg' ] ) ? $form->options[ $opt . '_msg' ] : $frm_settings->success_msg; |
|
2726 | + $message = isset( $form->options[$opt . '_msg'] ) ? $form->options[$opt . '_msg'] : $frm_settings->success_msg; |
|
2727 | 2727 | $class = 'frm_message'; |
2728 | 2728 | } else { |
2729 | 2729 | $message = $frm_settings->failed_msg; |
@@ -2947,7 +2947,7 @@ discard block |
||
2947 | 2947 | |
2948 | 2948 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
2949 | 2949 | |
2950 | - $html = FrmAppHelper::clip( |
|
2950 | + $html = FrmAppHelper::clip( |
|
2951 | 2951 | function() { |
2952 | 2952 | FrmAppHelper::maybe_autocomplete_pages_options( |
2953 | 2953 | array( |
@@ -76,7 +76,7 @@ |
||
76 | 76 | return false; |
77 | 77 | } |
78 | 78 | |
79 | - return $addons[ $addon_id ]; |
|
79 | + return $addons[$addon_id]; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -187,8 +187,8 @@ discard block |
||
187 | 187 | } |
188 | 188 | |
189 | 189 | foreach ( $settings as $setting => $default ) { |
190 | - if ( isset( $params[ 'frm_' . $setting ] ) ) { |
|
191 | - $this->{$setting} = $params[ 'frm_' . $setting ]; |
|
190 | + if ( isset( $params['frm_' . $setting] ) ) { |
|
191 | + $this->{$setting} = $params['frm_' . $setting]; |
|
192 | 192 | } elseif ( ! isset( $this->{$setting} ) ) { |
193 | 193 | $this->{$setting} = $default; |
194 | 194 | } |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | |
357 | 357 | $checkboxes = array( 'mu_menu', 're_multi', 'use_html', 'jquery_css', 'accordion_js', 'fade_form', 'no_ips', 'custom_header_ip', 'tracking', 'admin_bar', 'summary_emails' ); |
358 | 358 | foreach ( $checkboxes as $set ) { |
359 | - $this->$set = isset( $params[ 'frm_' . $set ] ) ? absint( $params[ 'frm_' . $set ] ) : 0; |
|
359 | + $this->$set = isset( $params['frm_' . $set] ) ? absint( $params['frm_' . $set] ) : 0; |
|
360 | 360 | } |
361 | 361 | } |
362 | 362 | |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | $frm_roles = FrmAppHelper::frm_capabilities(); |
370 | 370 | $roles = get_editable_roles(); |
371 | 371 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
372 | - $this->$frm_role = (array) ( isset( $params[ $frm_role ] ) ? $params[ $frm_role ] : 'administrator' ); |
|
372 | + $this->$frm_role = (array) ( isset( $params[$frm_role] ) ? $params[$frm_role] : 'administrator' ); |
|
373 | 373 | |
374 | 374 | // Make sure administrators always have permissions |
375 | 375 | if ( ! in_array( 'administrator', $this->$frm_role ) ) { |
@@ -76,7 +76,8 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | private function translate_settings( $settings ) { |
79 | - if ( $settings ) { // Workaround for W3 total cache conflict. |
|
79 | + if ( $settings ) { |
|
80 | +// Workaround for W3 total cache conflict. |
|
80 | 81 | return unserialize( serialize( $settings ) ); |
81 | 82 | } |
82 | 83 | |
@@ -88,7 +89,8 @@ discard block |
||
88 | 89 | } |
89 | 90 | |
90 | 91 | // If unserializing didn't work |
91 | - if ( $settings ) { // Workaround for W3 total cache conflict. |
|
92 | + if ( $settings ) { |
|
93 | +// Workaround for W3 total cache conflict. |
|
92 | 94 | $settings = unserialize( serialize( $settings ) ); |
93 | 95 | } else { |
94 | 96 | $settings = $this; |
@@ -108,7 +108,7 @@ |
||
108 | 108 | 'credit_card' => 'FrmFieldCreditCard', |
109 | 109 | ); |
110 | 110 | |
111 | - $class = isset( $type_classes[ $field_type ] ) ? $type_classes[ $field_type ] : ''; |
|
111 | + $class = isset( $type_classes[$field_type] ) ? $type_classes[$field_type] : ''; |
|
112 | 112 | |
113 | 113 | return apply_filters( 'frm_get_field_type_class', $class, $field_type ); |
114 | 114 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $values = FrmAppHelper::maybe_filter_array( $values, array( 'name', 'description' ) ); |
273 | 273 | |
274 | 274 | foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) { |
275 | - $new_values[ $col ] = $values[ $col ]; |
|
275 | + $new_values[$col] = $values[$col]; |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | $new_values['options'] = self::maybe_filter_options( $values['options'] ); |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | $new_values['created_at'] = current_time( 'mysql', 1 ); |
284 | 284 | |
285 | 285 | if ( isset( $values['id'] ) ) { |
286 | - $frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key']; |
|
286 | + $frm_duplicate_ids[$values['field_key']] = $new_values['field_key']; |
|
287 | 287 | $new_values = apply_filters( 'frm_duplicated_field', $new_values ); |
288 | 288 | } |
289 | 289 | |
@@ -292,9 +292,9 @@ discard block |
||
292 | 292 | foreach ( $new_values as $k => $v ) { |
293 | 293 | if ( is_array( $v ) ) { |
294 | 294 | if ( $k === 'default_value' ) { |
295 | - $new_values[ $k ] = FrmAppHelper::maybe_json_encode( $v ); |
|
295 | + $new_values[$k] = FrmAppHelper::maybe_json_encode( $v ); |
|
296 | 296 | } else { |
297 | - $new_values[ $k ] = serialize( $v ); |
|
297 | + $new_values[$k] = serialize( $v ); |
|
298 | 298 | } |
299 | 299 | } |
300 | 300 | unset( $k, $v ); |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | } |
315 | 315 | |
316 | 316 | if ( isset( $values['id'] ) ) { |
317 | - $frm_duplicate_ids[ $values['id'] ] = $new_id; |
|
317 | + $frm_duplicate_ids[$values['id']] = $new_id; |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | return $new_id; |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) { |
375 | 375 | global $frm_duplicate_ids; |
376 | 376 | |
377 | - $where = array( |
|
377 | + $where = array( |
|
378 | 378 | array( |
379 | 379 | 'or' => 1, |
380 | 380 | 'fi.form_id' => $old_form_id, |
@@ -420,8 +420,8 @@ discard block |
||
420 | 420 | |
421 | 421 | $values = apply_filters( 'frm_duplicated_field', $values ); |
422 | 422 | $new_id = self::create( $values ); |
423 | - $frm_duplicate_ids[ $field->id ] = $new_id; |
|
424 | - $frm_duplicate_ids[ $field->field_key ] = $new_id; |
|
423 | + $frm_duplicate_ids[$field->id] = $new_id; |
|
424 | + $frm_duplicate_ids[$field->field_key] = $new_id; |
|
425 | 425 | unset( $field ); |
426 | 426 | } |
427 | 427 | } |
@@ -453,11 +453,11 @@ discard block |
||
453 | 453 | |
454 | 454 | // serialize array values |
455 | 455 | foreach ( array( 'field_options', 'options' ) as $opt ) { |
456 | - if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) { |
|
456 | + if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) { |
|
457 | 457 | if ( 'field_options' === $opt ) { |
458 | - $values[ $opt ] = self::maybe_filter_options( $values[ $opt ] ); |
|
458 | + $values[$opt] = self::maybe_filter_options( $values[$opt] ); |
|
459 | 459 | } |
460 | - $values[ $opt ] = serialize( $values[ $opt ] ); |
|
460 | + $values[$opt] = serialize( $values[$opt] ); |
|
461 | 461 | } |
462 | 462 | } |
463 | 463 | if ( isset( $values['default_value'] ) && is_array( $values['default_value'] ) ) { |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | 'id' => $id, |
610 | 610 | 'field_key' => $id, |
611 | 611 | ); |
612 | - $type = FrmDb::get_var( 'frm_fields', $where, $col ); |
|
612 | + $type = FrmDb::get_var( 'frm_fields', $where, $col ); |
|
613 | 613 | } |
614 | 614 | |
615 | 615 | return $type; |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | continue; |
636 | 636 | } |
637 | 637 | |
638 | - $fields[ $result->id ] = $result; |
|
638 | + $fields[$result->id] = $result; |
|
639 | 639 | $count ++; |
640 | 640 | if ( $limit == 1 ) { |
641 | 641 | $fields = $result; |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | $count = 0; |
682 | 682 | foreach ( $results as $result ) { |
683 | 683 | $count ++; |
684 | - $fields[ $result->id ] = $result; |
|
684 | + $fields[$result->id] = $result; |
|
685 | 685 | if ( ! empty( $limit ) && $count >= $limit ) { |
686 | 686 | break; |
687 | 687 | } |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | } |
751 | 751 | |
752 | 752 | if ( ! empty( $sub_fields ) ) { |
753 | - $index = $k + $index_offset; |
|
753 | + $index = $k + $index_offset; |
|
754 | 754 | $index_offset += count( $sub_fields ); |
755 | 755 | array_splice( $results, $index, 0, $sub_fields ); |
756 | 756 | } |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | $query_type = ( $limit == ' LIMIT 1' || $limit == 1 ) ? 'row' : 'results'; |
796 | 796 | |
797 | 797 | if ( is_array( $where ) ) { |
798 | - $args = array( |
|
798 | + $args = array( |
|
799 | 799 | 'order_by' => $order_by, |
800 | 800 | 'limit' => $limit, |
801 | 801 | ); |
@@ -826,9 +826,9 @@ discard block |
||
826 | 826 | FrmDb::set_cache( $result->field_key, $result, 'frm_field' ); |
827 | 827 | |
828 | 828 | self::prepare_options( $result ); |
829 | - $results[ $r_key ]->field_options = $result->field_options; |
|
830 | - $results[ $r_key ]->options = $result->options; |
|
831 | - $results[ $r_key ]->default_value = $result->default_value; |
|
829 | + $results[$r_key]->field_options = $result->field_options; |
|
830 | + $results[$r_key]->options = $result->options; |
|
831 | + $results[$r_key]->default_value = $result->default_value; |
|
832 | 832 | |
833 | 833 | unset( $r_key, $result ); |
834 | 834 | } |
@@ -1030,23 +1030,23 @@ discard block |
||
1030 | 1030 | } |
1031 | 1031 | |
1032 | 1032 | public static function is_option_true_in_array( $field, $option ) { |
1033 | - return isset( $field[ $option ] ) && $field[ $option ]; |
|
1033 | + return isset( $field[$option] ) && $field[$option]; |
|
1034 | 1034 | } |
1035 | 1035 | |
1036 | 1036 | public static function is_option_true_in_object( $field, $option ) { |
1037 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ]; |
|
1037 | + return isset( $field->field_options[$option] ) && $field->field_options[$option]; |
|
1038 | 1038 | } |
1039 | 1039 | |
1040 | 1040 | public static function is_option_empty_in_array( $field, $option ) { |
1041 | - return ! isset( $field[ $option ] ) || empty( $field[ $option ] ); |
|
1041 | + return ! isset( $field[$option] ) || empty( $field[$option] ); |
|
1042 | 1042 | } |
1043 | 1043 | |
1044 | 1044 | public static function is_option_empty_in_object( $field, $option ) { |
1045 | - return ! isset( $field->field_options[ $option ] ) || empty( $field->field_options[ $option ] ); |
|
1045 | + return ! isset( $field->field_options[$option] ) || empty( $field->field_options[$option] ); |
|
1046 | 1046 | } |
1047 | 1047 | |
1048 | 1048 | public static function is_option_value_in_object( $field, $option ) { |
1049 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != ''; |
|
1049 | + return isset( $field->field_options[$option] ) && $field->field_options[$option] != ''; |
|
1050 | 1050 | } |
1051 | 1051 | |
1052 | 1052 | /** |
@@ -1064,10 +1064,10 @@ discard block |
||
1064 | 1064 | |
1065 | 1065 | public static function get_option_in_array( $field, $option ) { |
1066 | 1066 | |
1067 | - if ( isset( $field[ $option ] ) ) { |
|
1068 | - $this_option = $field[ $option ]; |
|
1069 | - } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) { |
|
1070 | - $this_option = $field['field_options'][ $option ]; |
|
1067 | + if ( isset( $field[$option] ) ) { |
|
1068 | + $this_option = $field[$option]; |
|
1069 | + } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) { |
|
1070 | + $this_option = $field['field_options'][$option]; |
|
1071 | 1071 | } else { |
1072 | 1072 | $this_option = ''; |
1073 | 1073 | } |
@@ -1076,7 +1076,7 @@ discard block |
||
1076 | 1076 | } |
1077 | 1077 | |
1078 | 1078 | public static function get_option_in_object( $field, $option ) { |
1079 | - return isset( $field->field_options[ $option ] ) ? $field->field_options[ $option ] : ''; |
|
1079 | + return isset( $field->field_options[$option] ) ? $field->field_options[$option] : ''; |
|
1080 | 1080 | } |
1081 | 1081 | |
1082 | 1082 | /** |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | $field_val = ''; |
145 | 145 | if ( is_object( $this->field ) ) { |
146 | 146 | $field_val = $this->field->{$column}; |
147 | - } elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) { |
|
148 | - $field_val = $this->field[ $column ]; |
|
147 | + } elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) { |
|
148 | + $field_val = $this->field[$column]; |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | return $field_val; |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | if ( is_object( $this->field ) ) { |
160 | 160 | $this->field->{$column} = $value; |
161 | 161 | } elseif ( is_array( $this->field ) ) { |
162 | - $this->field[ $column ] = $value; |
|
162 | + $this->field[$column] = $value; |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 | |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | printf( |
549 | 549 | /* translators: %s: Field type */ |
550 | 550 | esc_html__( '%s Options', 'formidable' ), |
551 | - esc_html( $all_field_types[ $args['display']['type'] ]['name'] ) |
|
551 | + esc_html( $all_field_types[$args['display']['type']]['name'] ) |
|
552 | 552 | ); |
553 | 553 | FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown6_icon', array( 'aria-hidden' => 'true' ) ); |
554 | 554 | ?> |
@@ -681,8 +681,8 @@ discard block |
||
681 | 681 | |
682 | 682 | $fields = array_merge( $fields, $pro_fields ); |
683 | 683 | |
684 | - if ( isset( $fields[ $this->type ] ) ) { |
|
685 | - $name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ]; |
|
684 | + if ( isset( $fields[$this->type] ) ) { |
|
685 | + $name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type]; |
|
686 | 686 | } |
687 | 687 | |
688 | 688 | return $name; |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | * @return array |
700 | 700 | */ |
701 | 701 | public function get_default_field_options() { |
702 | - $opts = array( |
|
702 | + $opts = array( |
|
703 | 703 | 'size' => '', |
704 | 704 | 'max' => '', |
705 | 705 | 'label' => '', |
@@ -1066,7 +1066,7 @@ discard block |
||
1066 | 1066 | } |
1067 | 1067 | } else { |
1068 | 1068 | $args['save_array'] = $this->is_readonly_array(); |
1069 | - $hidden .= $this->show_single_hidden( $selected_value, $args ); |
|
1069 | + $hidden .= $this->show_single_hidden( $selected_value, $args ); |
|
1070 | 1070 | } |
1071 | 1071 | |
1072 | 1072 | return $hidden; |
@@ -1075,7 +1075,7 @@ discard block |
||
1075 | 1075 | protected function show_single_hidden( $selected, $args ) { |
1076 | 1076 | if ( $args['save_array'] ) { |
1077 | 1077 | $args['field_name'] .= '[]'; |
1078 | - $id = ''; |
|
1078 | + $id = ''; |
|
1079 | 1079 | } else { |
1080 | 1080 | $id = ' id="' . esc_attr( $args['html_id'] ) . '"'; |
1081 | 1081 | } |
@@ -1091,8 +1091,8 @@ discard block |
||
1091 | 1091 | $selected = $values['field_value']; |
1092 | 1092 | |
1093 | 1093 | if ( isset( $values['combo_name'] ) ) { |
1094 | - $options = $options[ $values['combo_name'] ]; |
|
1095 | - $selected = ( is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ) ? $selected[ $values['combo_name'] ] : ''; |
|
1094 | + $options = $options[$values['combo_name']]; |
|
1095 | + $selected = ( is_array( $selected ) && isset( $selected[$values['combo_name']] ) ) ? $selected[$values['combo_name']] : ''; |
|
1096 | 1096 | } |
1097 | 1097 | |
1098 | 1098 | $input = $this->select_tag( $values ); |
@@ -1143,7 +1143,7 @@ discard block |
||
1143 | 1143 | } |
1144 | 1144 | |
1145 | 1145 | protected function fill_display_field_values( $args = array() ) { |
1146 | - $defaults = array( |
|
1146 | + $defaults = array( |
|
1147 | 1147 | 'field_name' => 'item_meta[' . $this->get_field_column( 'id' ) . ']', |
1148 | 1148 | 'field_id' => $this->get_field_column( 'id' ), |
1149 | 1149 | 'field_plus_id' => '', |
@@ -1196,7 +1196,7 @@ discard block |
||
1196 | 1196 | } |
1197 | 1197 | } |
1198 | 1198 | |
1199 | - if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) { |
|
1199 | + if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) { |
|
1200 | 1200 | if ( $error_comes_first ) { |
1201 | 1201 | array_unshift( $describedby, 'frm_error_' . $args['html_id'] ); |
1202 | 1202 | } else { |
@@ -1275,11 +1275,11 @@ discard block |
||
1275 | 1275 | |
1276 | 1276 | $field_id = $this->get_field_column( 'id' ); |
1277 | 1277 | if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) { |
1278 | - $frm_validated_unique_values[ $field_id ] = array(); |
|
1278 | + $frm_validated_unique_values[$field_id] = array(); |
|
1279 | 1279 | return false; |
1280 | 1280 | } |
1281 | 1281 | |
1282 | - $already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true ); |
|
1282 | + $already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true ); |
|
1283 | 1283 | return $already_validated_this_value; |
1284 | 1284 | } |
1285 | 1285 | |
@@ -1304,7 +1304,7 @@ discard block |
||
1304 | 1304 | private function value_validated_as_unique( $value ) { |
1305 | 1305 | global $frm_validated_unique_values; |
1306 | 1306 | $field_id = $this->get_field_column( 'id' ); |
1307 | - $frm_validated_unique_values[ $field_id ][] = $value; |
|
1307 | + $frm_validated_unique_values[$field_id][] = $value; |
|
1308 | 1308 | } |
1309 | 1309 | |
1310 | 1310 | public function get_value_to_save( $value, $atts ) { |
@@ -1336,8 +1336,8 @@ discard block |
||
1336 | 1336 | $value = $this->prepare_display_value( $value, $atts ); |
1337 | 1337 | |
1338 | 1338 | if ( is_array( $value ) ) { |
1339 | - if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[ $atts['show'] ] ) ) { |
|
1340 | - $value = $value[ $atts['show'] ]; |
|
1339 | + if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[$atts['show']] ) ) { |
|
1340 | + $value = $value[$atts['show']]; |
|
1341 | 1341 | } elseif ( ! isset( $atts['return_array'] ) || ! $atts['return_array'] ) { |
1342 | 1342 | $sep = isset( $atts['sep'] ) ? $atts['sep'] : ', '; |
1343 | 1343 | $value = implode( $sep, $value ); |
@@ -1406,8 +1406,8 @@ discard block |
||
1406 | 1406 | $saved_entries = $atts['ids']; |
1407 | 1407 | $new_value = array(); |
1408 | 1408 | foreach ( (array) $value as $old_child_id ) { |
1409 | - if ( isset( $saved_entries[ $old_child_id ] ) ) { |
|
1410 | - $new_value[] = $saved_entries[ $old_child_id ]; |
|
1409 | + if ( isset( $saved_entries[$old_child_id] ) ) { |
|
1410 | + $new_value[] = $saved_entries[$old_child_id]; |
|
1411 | 1411 | } |
1412 | 1412 | } |
1413 | 1413 |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | 'fill' => '#4d4d4d', |
179 | 179 | 'orange' => '#f05a24', |
180 | 180 | ); |
181 | - $atts = array_merge( $defaults, $atts ); |
|
181 | + $atts = array_merge( $defaults, $atts ); |
|
182 | 182 | |
183 | 183 | return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 599.68 601.37" width="' . esc_attr( $atts['width'] ) . '" height="' . esc_attr( $atts['height'] ) . '"> |
184 | 184 | <path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/> |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | * @return string |
390 | 390 | */ |
391 | 391 | public static function get_server_value( $value ) { |
392 | - return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : ''; |
|
392 | + return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : ''; |
|
393 | 393 | } |
394 | 394 | |
395 | 395 | /** |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | $ip = ''; |
425 | 425 | |
426 | 426 | foreach ( $ip_options as $key ) { |
427 | - if ( ! isset( $_SERVER[ $key ] ) ) { |
|
427 | + if ( ! isset( $_SERVER[$key] ) ) { |
|
428 | 428 | continue; |
429 | 429 | } |
430 | 430 | |
@@ -492,10 +492,10 @@ discard block |
||
492 | 492 | } |
493 | 493 | |
494 | 494 | if ( $src === 'get' ) { |
495 | - $value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
|
496 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
495 | + $value = isset( $_POST[$param] ) ? wp_unslash( $_POST[$param] ) : ( isset( $_GET[$param] ) ? wp_unslash( $_GET[$param] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
|
496 | + if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
497 | 497 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
498 | - $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
|
498 | + $value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) ); |
|
499 | 499 | } |
500 | 500 | self::sanitize_value( $sanitize, $value ); |
501 | 501 | } else { |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | } |
517 | 517 | |
518 | 518 | $p = trim( $p, ']' ); |
519 | - $value = isset( $value[ $p ] ) ? $value[ $p ] : $default; |
|
519 | + $value = isset( $value[$p] ) ? $value[$p] : $default; |
|
520 | 520 | } |
521 | 521 | } |
522 | 522 | |
@@ -572,26 +572,26 @@ discard block |
||
572 | 572 | 'sanitize' => 'sanitize_text_field', |
573 | 573 | 'serialized' => false, |
574 | 574 | ); |
575 | - $args = wp_parse_args( $args, $defaults ); |
|
575 | + $args = wp_parse_args( $args, $defaults ); |
|
576 | 576 | |
577 | 577 | $value = $args['default']; |
578 | 578 | if ( $args['type'] === 'get' ) { |
579 | - if ( $_GET && isset( $_GET[ $args['param'] ] ) ) { |
|
579 | + if ( $_GET && isset( $_GET[$args['param']] ) ) { |
|
580 | 580 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
581 | - $value = wp_unslash( $_GET[ $args['param'] ] ); |
|
581 | + $value = wp_unslash( $_GET[$args['param']] ); |
|
582 | 582 | } |
583 | 583 | } elseif ( $args['type'] === 'post' ) { |
584 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
584 | + if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
585 | 585 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
586 | - $value = wp_unslash( $_POST[ $args['param'] ] ); |
|
586 | + $value = wp_unslash( $_POST[$args['param']] ); |
|
587 | 587 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
588 | 588 | self::unserialize_or_decode( $value ); |
589 | 589 | } |
590 | 590 | } |
591 | 591 | } else { |
592 | - if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
592 | + if ( isset( $_REQUEST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
593 | 593 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
594 | - $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
|
594 | + $value = wp_unslash( $_REQUEST[$args['param']] ); |
|
595 | 595 | } |
596 | 596 | } |
597 | 597 | |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | if ( is_array( $value ) ) { |
624 | 624 | $temp_values = $value; |
625 | 625 | foreach ( $temp_values as $k => $v ) { |
626 | - self::sanitize_value( $sanitize, $value[ $k ] ); |
|
626 | + self::sanitize_value( $sanitize, $value[$k] ); |
|
627 | 627 | } |
628 | 628 | } else { |
629 | 629 | $value = call_user_func( $sanitize, $value ); |
@@ -634,8 +634,8 @@ discard block |
||
634 | 634 | public static function sanitize_request( $sanitize_method, &$values ) { |
635 | 635 | $temp_values = $values; |
636 | 636 | foreach ( $temp_values as $k => $val ) { |
637 | - if ( isset( $sanitize_method[ $k ] ) ) { |
|
638 | - $values[ $k ] = call_user_func( $sanitize_method[ $k ], $val ); |
|
637 | + if ( isset( $sanitize_method[$k] ) ) { |
|
638 | + $values[$k] = call_user_func( $sanitize_method[$k], $val ); |
|
639 | 639 | } |
640 | 640 | } |
641 | 641 | } |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | if ( is_array( $value ) ) { |
659 | 659 | $temp_values = $value; |
660 | 660 | foreach ( $temp_values as $k => $v ) { |
661 | - self::decode_specialchars( $value[ $k ] ); |
|
661 | + self::decode_specialchars( $value[$k] ); |
|
662 | 662 | } |
663 | 663 | } else { |
664 | 664 | self::decode_amp( $value ); |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | * @return array |
779 | 779 | */ |
780 | 780 | public static function add_allowed_submit_button_tags( $allowed_html ) { |
781 | - $allowed_html['input'] = array( |
|
781 | + $allowed_html['input'] = array( |
|
782 | 782 | 'type' => true, |
783 | 783 | 'value' => true, |
784 | 784 | 'formnovalidate' => true, |
@@ -801,7 +801,7 @@ discard block |
||
801 | 801 | $allowed_html = $html; |
802 | 802 | } elseif ( ! empty( $allowed ) ) { |
803 | 803 | foreach ( (array) $allowed as $a ) { |
804 | - $allowed_html[ $a ] = isset( $html[ $a ] ) ? $html[ $a ] : array(); |
|
804 | + $allowed_html[$a] = isset( $html[$a] ) ? $html[$a] : array(); |
|
805 | 805 | } |
806 | 806 | } |
807 | 807 | |
@@ -980,8 +980,8 @@ discard block |
||
980 | 980 | } |
981 | 981 | |
982 | 982 | global $wp_query; |
983 | - if ( isset( $wp_query->query_vars[ $param ] ) ) { |
|
984 | - $value = $wp_query->query_vars[ $param ]; |
|
983 | + if ( isset( $wp_query->query_vars[$param] ) ) { |
|
984 | + $value = $wp_query->query_vars[$param]; |
|
985 | 985 | } |
986 | 986 | |
987 | 987 | return $value; |
@@ -1008,9 +1008,9 @@ discard block |
||
1008 | 1008 | $deprecated = array( |
1009 | 1009 | 'frm_clone_solid_icon' => 'frm_clone_icon', |
1010 | 1010 | ); |
1011 | - if ( isset( $deprecated[ $icon ] ) ) { |
|
1012 | - $icon = $deprecated[ $icon ]; |
|
1013 | - $class = str_replace( $icon, $deprecated[ $icon ], $class ); |
|
1011 | + if ( isset( $deprecated[$icon] ) ) { |
|
1012 | + $icon = $deprecated[$icon]; |
|
1013 | + $class = str_replace( $icon, $deprecated[$icon], $class ); |
|
1014 | 1014 | } |
1015 | 1015 | |
1016 | 1016 | if ( $icon === $class ) { |
@@ -1338,7 +1338,7 @@ discard block |
||
1338 | 1338 | 'new_file_path' => self::plugin_path() . '/js', |
1339 | 1339 | ) |
1340 | 1340 | ); |
1341 | - $new_file = new FrmCreateFile( $file_atts ); |
|
1341 | + $new_file = new FrmCreateFile( $file_atts ); |
|
1342 | 1342 | |
1343 | 1343 | $files = array( |
1344 | 1344 | self::plugin_path() . '/js/formidable.min.js', |
@@ -1357,7 +1357,7 @@ discard block |
||
1357 | 1357 | 'new_file_path' => self::plugin_path() . '/js', |
1358 | 1358 | ) |
1359 | 1359 | ); |
1360 | - $new_file = new FrmCreateFile( $file_atts ); |
|
1360 | + $new_file = new FrmCreateFile( $file_atts ); |
|
1361 | 1361 | $files = array( |
1362 | 1362 | FrmStrpLiteAppHelper::plugin_path() . 'js/frmstrp.min.js', |
1363 | 1363 | ); |
@@ -1842,8 +1842,8 @@ discard block |
||
1842 | 1842 | return $error; |
1843 | 1843 | } |
1844 | 1844 | |
1845 | - $nonce_value = ( $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : ''; |
|
1846 | - if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
1845 | + $nonce_value = ( $_REQUEST && isset( $_REQUEST[$nonce_name] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : ''; |
|
1846 | + if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
1847 | 1847 | $frm_settings = self::get_settings(); |
1848 | 1848 | $error = $frm_settings->admin_permission; |
1849 | 1849 | } |
@@ -1878,7 +1878,7 @@ discard block |
||
1878 | 1878 | } else { |
1879 | 1879 | foreach ( $value as $k => $v ) { |
1880 | 1880 | if ( ! is_array( $v ) ) { |
1881 | - $value[ $k ] = call_user_func( $original_function, $v ); |
|
1881 | + $value[$k] = call_user_func( $original_function, $v ); |
|
1882 | 1882 | } |
1883 | 1883 | } |
1884 | 1884 | } |
@@ -1903,7 +1903,7 @@ discard block |
||
1903 | 1903 | $return = array_merge( $return, self::array_flatten( $value, $keys ) ); |
1904 | 1904 | } else { |
1905 | 1905 | if ( $keys === 'keep' ) { |
1906 | - $return[ $key ] = $value; |
|
1906 | + $return[$key] = $value; |
|
1907 | 1907 | } else { |
1908 | 1908 | $return[] = $value; |
1909 | 1909 | } |
@@ -1956,11 +1956,11 @@ discard block |
||
1956 | 1956 | } |
1957 | 1957 | |
1958 | 1958 | $ver = $default; |
1959 | - if ( ! isset( $wp_scripts->registered[ $handle ] ) ) { |
|
1959 | + if ( ! isset( $wp_scripts->registered[$handle] ) ) { |
|
1960 | 1960 | return $ver; |
1961 | 1961 | } |
1962 | 1962 | |
1963 | - $query = $wp_scripts->registered[ $handle ]; |
|
1963 | + $query = $wp_scripts->registered[$handle]; |
|
1964 | 1964 | if ( is_object( $query ) && ! empty( $query->ver ) ) { |
1965 | 1965 | $ver = $query->ver; |
1966 | 1966 | } |
@@ -2066,7 +2066,7 @@ discard block |
||
2066 | 2066 | $suffix = 2; |
2067 | 2067 | do { |
2068 | 2068 | $key_check = $key . $separator . $suffix; |
2069 | - ++$suffix; |
|
2069 | + ++ $suffix; |
|
2070 | 2070 | } while ( in_array( $key_check, $similar_keys, true ) ); |
2071 | 2071 | |
2072 | 2072 | $key = $key_check; |
@@ -2167,7 +2167,7 @@ discard block |
||
2167 | 2167 | |
2168 | 2168 | foreach ( array( 'name', 'description' ) as $var ) { |
2169 | 2169 | $default_val = isset( $record->{$var} ) ? $record->{$var} : ''; |
2170 | - $values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2170 | + $values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
2171 | 2171 | unset( $var, $default_val ); |
2172 | 2172 | } |
2173 | 2173 | |
@@ -2225,9 +2225,9 @@ discard block |
||
2225 | 2225 | } |
2226 | 2226 | } |
2227 | 2227 | |
2228 | - $field_type = isset( $post_values['field_options'][ 'type_' . $field->id ] ) ? $post_values['field_options'][ 'type_' . $field->id ] : $field->type; |
|
2229 | - if ( isset( $post_values['item_meta'][ $field->id ] ) ) { |
|
2230 | - $new_value = $post_values['item_meta'][ $field->id ]; |
|
2228 | + $field_type = isset( $post_values['field_options']['type_' . $field->id] ) ? $post_values['field_options']['type_' . $field->id] : $field->type; |
|
2229 | + if ( isset( $post_values['item_meta'][$field->id] ) ) { |
|
2230 | + $new_value = $post_values['item_meta'][$field->id]; |
|
2231 | 2231 | self::unserialize_or_decode( $new_value ); |
2232 | 2232 | } else { |
2233 | 2233 | $new_value = $meta_value; |
@@ -2248,7 +2248,7 @@ discard block |
||
2248 | 2248 | |
2249 | 2249 | $field_array = array_merge( (array) $field->field_options, $field_array ); |
2250 | 2250 | |
2251 | - $values['fields'][ $field->id ] = $field_array; |
|
2251 | + $values['fields'][$field->id] = $field_array; |
|
2252 | 2252 | } |
2253 | 2253 | |
2254 | 2254 | /** |
@@ -2295,11 +2295,11 @@ discard block |
||
2295 | 2295 | } |
2296 | 2296 | |
2297 | 2297 | foreach ( $form->options as $opt => $value ) { |
2298 | - if ( isset( $post_values[ $opt ] ) ) { |
|
2299 | - $values[ $opt ] = $post_values[ $opt ]; |
|
2300 | - self::unserialize_or_decode( $values[ $opt ] ); |
|
2298 | + if ( isset( $post_values[$opt] ) ) { |
|
2299 | + $values[$opt] = $post_values[$opt]; |
|
2300 | + self::unserialize_or_decode( $values[$opt] ); |
|
2301 | 2301 | } else { |
2302 | - $values[ $opt ] = $value; |
|
2302 | + $values[$opt] = $value; |
|
2303 | 2303 | } |
2304 | 2304 | } |
2305 | 2305 | |
@@ -2313,8 +2313,8 @@ discard block |
||
2313 | 2313 | $form_defaults = FrmFormsHelper::get_default_opts(); |
2314 | 2314 | |
2315 | 2315 | foreach ( $form_defaults as $opt => $default ) { |
2316 | - if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) { |
|
2317 | - $values[ $opt ] = ( $post_values && isset( $post_values['options'][ $opt ] ) ) ? $post_values['options'][ $opt ] : $default; |
|
2316 | + if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) { |
|
2317 | + $values[$opt] = ( $post_values && isset( $post_values['options'][$opt] ) ) ? $post_values['options'][$opt] : $default; |
|
2318 | 2318 | } |
2319 | 2319 | |
2320 | 2320 | unset( $opt, $default ); |
@@ -2325,8 +2325,8 @@ discard block |
||
2325 | 2325 | } |
2326 | 2326 | |
2327 | 2327 | foreach ( array( 'before', 'after', 'submit' ) as $h ) { |
2328 | - if ( ! isset( $values[ $h . '_html' ] ) ) { |
|
2329 | - $values[ $h . '_html' ] = ( isset( $post_values['options'][ $h . '_html' ] ) ? $post_values['options'][ $h . '_html' ] : FrmFormsHelper::get_default_html( $h ) ); |
|
2328 | + if ( ! isset( $values[$h . '_html'] ) ) { |
|
2329 | + $values[$h . '_html'] = ( isset( $post_values['options'][$h . '_html'] ) ? $post_values['options'][$h . '_html'] : FrmFormsHelper::get_default_html( $h ) ); |
|
2330 | 2330 | } |
2331 | 2331 | unset( $h ); |
2332 | 2332 | } |
@@ -2478,25 +2478,25 @@ discard block |
||
2478 | 2478 | if ( ! is_numeric( $levels ) ) { |
2479 | 2479 | // Show time in specified unit. |
2480 | 2480 | $levels = self::get_unit( $levels ); |
2481 | - if ( isset( $time_strings[ $levels ] ) ) { |
|
2481 | + if ( isset( $time_strings[$levels] ) ) { |
|
2482 | 2482 | $diff = array( |
2483 | 2483 | $levels => self::time_format( $levels, $diff ), |
2484 | 2484 | ); |
2485 | 2485 | $time_strings = array( |
2486 | - $levels => $time_strings[ $levels ], |
|
2486 | + $levels => $time_strings[$levels], |
|
2487 | 2487 | ); |
2488 | 2488 | } |
2489 | 2489 | $levels = 1; |
2490 | 2490 | } |
2491 | 2491 | |
2492 | 2492 | foreach ( $time_strings as $k => $v ) { |
2493 | - if ( isset( $diff[ $k ] ) && $diff[ $k ] ) { |
|
2494 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] ); |
|
2495 | - } elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) { |
|
2493 | + if ( isset( $diff[$k] ) && $diff[$k] ) { |
|
2494 | + $time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] ); |
|
2495 | + } elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) { |
|
2496 | 2496 | // Account for 0. |
2497 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1]; |
|
2497 | + $time_strings[$k] = $diff[$k] . ' ' . $v[1]; |
|
2498 | 2498 | } else { |
2499 | - unset( $time_strings[ $k ] ); |
|
2499 | + unset( $time_strings[$k] ); |
|
2500 | 2500 | } |
2501 | 2501 | } |
2502 | 2502 | |
@@ -2515,8 +2515,8 @@ discard block |
||
2515 | 2515 | 'y' => 'y', |
2516 | 2516 | 'd' => 'days', |
2517 | 2517 | ); |
2518 | - if ( isset( $return[ $unit ] ) ) { |
|
2519 | - return $diff[ $return[ $unit ] ]; |
|
2518 | + if ( isset( $return[$unit] ) ) { |
|
2519 | + return $diff[$return[$unit]]; |
|
2520 | 2520 | } |
2521 | 2521 | |
2522 | 2522 | $total = $diff['days'] * self::convert_time( 'd', $unit ); |
@@ -2524,11 +2524,11 @@ discard block |
||
2524 | 2524 | $times = array( 'h', 'i', 's' ); |
2525 | 2525 | |
2526 | 2526 | foreach ( $times as $time ) { |
2527 | - if ( ! isset( $diff[ $time ] ) ) { |
|
2527 | + if ( ! isset( $diff[$time] ) ) { |
|
2528 | 2528 | continue; |
2529 | 2529 | } |
2530 | 2530 | |
2531 | - $total += $diff[ $time ] * self::convert_time( $time, $unit ); |
|
2531 | + $total += $diff[$time] * self::convert_time( $time, $unit ); |
|
2532 | 2532 | } |
2533 | 2533 | |
2534 | 2534 | return floor( $total ); |
@@ -2548,7 +2548,7 @@ discard block |
||
2548 | 2548 | 'y' => DAY_IN_SECONDS * 365.25, |
2549 | 2549 | ); |
2550 | 2550 | |
2551 | - return $convert[ $from ] / $convert[ $to ]; |
|
2551 | + return $convert[$from] / $convert[$to]; |
|
2552 | 2552 | } |
2553 | 2553 | |
2554 | 2554 | /** |
@@ -2556,7 +2556,7 @@ discard block |
||
2556 | 2556 | */ |
2557 | 2557 | private static function get_unit( $unit ) { |
2558 | 2558 | $units = self::get_time_strings(); |
2559 | - if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) { |
|
2559 | + if ( isset( $units[$unit] ) || is_numeric( $unit ) ) { |
|
2560 | 2560 | return $unit; |
2561 | 2561 | } |
2562 | 2562 | |
@@ -2667,17 +2667,17 @@ discard block |
||
2667 | 2667 | |
2668 | 2668 | case 1: |
2669 | 2669 | $l2 = $name; |
2670 | - self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] ); |
|
2670 | + self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] ); |
|
2671 | 2671 | break; |
2672 | 2672 | |
2673 | 2673 | case 2: |
2674 | 2674 | $l3 = $name; |
2675 | - self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] ); |
|
2675 | + self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] ); |
|
2676 | 2676 | break; |
2677 | 2677 | |
2678 | 2678 | case 3: |
2679 | 2679 | $l4 = $name; |
2680 | - self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] ); |
|
2680 | + self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] ); |
|
2681 | 2681 | } |
2682 | 2682 | |
2683 | 2683 | unset( $this_val, $n ); |
@@ -2696,8 +2696,8 @@ discard block |
||
2696 | 2696 | public static function add_value_to_array( $name, $l1, $val, &$vars ) { |
2697 | 2697 | if ( $name == '' ) { |
2698 | 2698 | $vars[] = $val; |
2699 | - } elseif ( ! isset( $vars[ $l1 ] ) ) { |
|
2700 | - $vars[ $l1 ] = $val; |
|
2699 | + } elseif ( ! isset( $vars[$l1] ) ) { |
|
2700 | + $vars[$l1] = $val; |
|
2701 | 2701 | } |
2702 | 2702 | } |
2703 | 2703 | |
@@ -2714,7 +2714,7 @@ discard block |
||
2714 | 2714 | 'new_tab' => __( 'This option will open the link in a new browser tab. Please note that some popup blockers may prevent this from happening, in which case the link will be displayed.', 'formidable' ), |
2715 | 2715 | ); |
2716 | 2716 | |
2717 | - if ( ! isset( $tooltips[ $name ] ) ) { |
|
2717 | + if ( ! isset( $tooltips[$name] ) ) { |
|
2718 | 2718 | return; |
2719 | 2719 | } |
2720 | 2720 | |
@@ -2724,7 +2724,7 @@ discard block |
||
2724 | 2724 | echo ' class="frm_help"'; |
2725 | 2725 | } |
2726 | 2726 | |
2727 | - echo ' title="' . esc_attr( $tooltips[ $name ] ); |
|
2727 | + echo ' title="' . esc_attr( $tooltips[$name] ); |
|
2728 | 2728 | |
2729 | 2729 | if ( 'open' != $class ) { |
2730 | 2730 | echo '"'; |
@@ -2783,13 +2783,13 @@ discard block |
||
2783 | 2783 | } |
2784 | 2784 | |
2785 | 2785 | private static function prepare_action_slashes( $val, $key, &$post_content ) { |
2786 | - if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) { |
|
2786 | + if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) { |
|
2787 | 2787 | return; |
2788 | 2788 | } |
2789 | 2789 | |
2790 | 2790 | if ( is_array( $val ) ) { |
2791 | 2791 | foreach ( $val as $k1 => $v1 ) { |
2792 | - self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] ); |
|
2792 | + self::prepare_action_slashes( $v1, $k1, $post_content[$key] ); |
|
2793 | 2793 | unset( $k1, $v1 ); |
2794 | 2794 | } |
2795 | 2795 | } else { |
@@ -2797,7 +2797,7 @@ discard block |
||
2797 | 2797 | $val = stripslashes( $val ); |
2798 | 2798 | |
2799 | 2799 | // Add backslashes before double quotes and forward slashes only |
2800 | - $post_content[ $key ] = addcslashes( $val, '"\\/' ); |
|
2800 | + $post_content[$key] = addcslashes( $val, '"\\/' ); |
|
2801 | 2801 | } |
2802 | 2802 | } |
2803 | 2803 | |
@@ -2918,14 +2918,14 @@ discard block |
||
2918 | 2918 | continue; |
2919 | 2919 | } |
2920 | 2920 | $key = $input['name']; |
2921 | - if ( isset( $formatted[ $key ] ) ) { |
|
2922 | - if ( is_array( $formatted[ $key ] ) ) { |
|
2923 | - $formatted[ $key ][] = $input['value']; |
|
2921 | + if ( isset( $formatted[$key] ) ) { |
|
2922 | + if ( is_array( $formatted[$key] ) ) { |
|
2923 | + $formatted[$key][] = $input['value']; |
|
2924 | 2924 | } else { |
2925 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
2925 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
2926 | 2926 | } |
2927 | 2927 | } else { |
2928 | - $formatted[ $key ] = $input['value']; |
|
2928 | + $formatted[$key] = $input['value']; |
|
2929 | 2929 | } |
2930 | 2930 | } |
2931 | 2931 | |
@@ -3603,8 +3603,8 @@ discard block |
||
3603 | 3603 | } |
3604 | 3604 | |
3605 | 3605 | foreach ( $keys as $key ) { |
3606 | - if ( isset( $values[ $key ] ) ) { |
|
3607 | - $values[ $key ] = self::kses( $values[ $key ], 'all' ); |
|
3606 | + if ( isset( $values[$key] ) ) { |
|
3607 | + $values[$key] = self::kses( $values[$key], 'all' ); |
|
3608 | 3608 | } |
3609 | 3609 | } |
3610 | 3610 | |
@@ -3763,7 +3763,7 @@ discard block |
||
3763 | 3763 | return 0; |
3764 | 3764 | } |
3765 | 3765 | |
3766 | - return strlen( $parts[ count( $parts ) - 1 ] ); |
|
3766 | + return strlen( $parts[count( $parts ) - 1] ); |
|
3767 | 3767 | } |
3768 | 3768 | |
3769 | 3769 | /** |
@@ -493,7 +493,8 @@ discard block |
||
493 | 493 | |
494 | 494 | if ( $src === 'get' ) { |
495 | 495 | $value = isset( $_POST[ $param ] ) ? wp_unslash( $_POST[ $param ] ) : ( isset( $_GET[ $param ] ) ? wp_unslash( $_GET[ $param ] ) : $default ); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
496 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
496 | + if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { |
|
497 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
497 | 498 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
498 | 499 | $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
499 | 500 | } |
@@ -581,7 +582,8 @@ discard block |
||
581 | 582 | $value = wp_unslash( $_GET[ $args['param'] ] ); |
582 | 583 | } |
583 | 584 | } elseif ( $args['type'] === 'post' ) { |
584 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
585 | + if ( isset( $_POST[ $args['param'] ] ) ) { |
|
586 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
585 | 587 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
586 | 588 | $value = wp_unslash( $_POST[ $args['param'] ] ); |
587 | 589 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
@@ -589,7 +591,8 @@ discard block |
||
589 | 591 | } |
590 | 592 | } |
591 | 593 | } else { |
592 | - if ( isset( $_REQUEST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
594 | + if ( isset( $_REQUEST[ $args['param'] ] ) ) { |
|
595 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
593 | 596 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
594 | 597 | $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
595 | 598 | } |