@@ -146,7 +146,7 @@ |
||
146 | 146 | |
147 | 147 | $next_dir = ''; |
148 | 148 | foreach ( $dir_names as $dir ) { |
149 | - $next_dir .= '/' . $dir; |
|
149 | + $next_dir .= '/' . $dir; |
|
150 | 150 | $needed_dirs[] = $this->uploads['basedir'] . $next_dir; |
151 | 151 | } |
152 | 152 |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * @param array $atts |
72 | 72 | */ |
73 | 73 | private function init_style_settings( $atts ) { |
74 | - $style_settings = array( |
|
74 | + $style_settings = array( |
|
75 | 75 | 'border_color' => 'dddddd', |
76 | 76 | 'bg_color' => 'f7f7f7', |
77 | 77 | 'text_color' => '444444', |
@@ -82,12 +82,12 @@ discard block |
||
82 | 82 | $this->style_settings = apply_filters( 'frm_show_entry_styles', $style_settings ); |
83 | 83 | |
84 | 84 | foreach ( $this->style_settings as $key => $setting ) { |
85 | - if ( isset( $atts[ $key ] ) && $atts[ $key ] !== '' ) { |
|
86 | - $this->style_settings[ $key ] = $atts[ $key ]; |
|
85 | + if ( isset( $atts[$key] ) && $atts[$key] !== '' ) { |
|
86 | + $this->style_settings[$key] = $atts[$key]; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | if ( $this->is_color_setting( $key ) ) { |
90 | - $this->style_settings[ $key ] = $this->get_color_markup( $this->style_settings[ $key ] ); |
|
90 | + $this->style_settings[$key] = $this->get_color_markup( $this->style_settings[$key] ); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | return $errors; |
12 | 12 | } |
13 | 13 | |
14 | - if ( FrmAppHelper::is_admin() && is_user_logged_in() && ( ! isset( $values[ 'frm_submit_entry_' . $values['form_id'] ] ) || ! wp_verify_nonce( $values[ 'frm_submit_entry_' . $values['form_id'] ], 'frm_submit_entry_nonce' ) ) ) { |
|
14 | + if ( FrmAppHelper::is_admin() && is_user_logged_in() && ( ! isset( $values['frm_submit_entry_' . $values['form_id']] ) || ! wp_verify_nonce( $values['frm_submit_entry_' . $values['form_id']], 'frm_submit_entry_nonce' ) ) ) { |
|
15 | 15 | $errors['form'] = __( 'You do not have permission to do that', 'formidable' ); |
16 | 16 | } |
17 | 17 | |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | 'key_pointer' => '', // the pointer in the posted array |
66 | 66 | 'exclude' => array(), // exclude these field types from validation |
67 | 67 | ); |
68 | - $args = wp_parse_args( $args, $defaults ); |
|
68 | + $args = wp_parse_args( $args, $defaults ); |
|
69 | 69 | |
70 | 70 | if ( empty( $args['parent_field_id'] ) ) { |
71 | - $value = isset( $values['item_meta'][ $args['id'] ] ) ? $values['item_meta'][ $args['id'] ] : ''; |
|
71 | + $value = isset( $values['item_meta'][$args['id']] ) ? $values['item_meta'][$args['id']] : ''; |
|
72 | 72 | } else { |
73 | 73 | // value is from a nested form |
74 | 74 | $value = $values; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | if ( $posted_field->required == '1' && FrmAppHelper::is_empty_value( $value ) ) { |
92 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' ); |
|
92 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' ); |
|
93 | 93 | } elseif ( $posted_field->type == 'text' && ! isset( $_POST['item_name'] ) ) { // WPCS: CSRF ok. |
94 | 94 | $_POST['item_name'] = $value; |
95 | 95 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $pattern = self::phone_format( $field ); |
143 | 143 | |
144 | 144 | if ( ! preg_match( $pattern, $value ) ) { |
145 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $field, 'invalid' ); |
|
145 | + $errors['field' . $args['id']] = FrmFieldsHelper::get_error_msg( $field, 'invalid' ); |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | } |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | |
379 | 379 | // Send any potentially useful $_SERVER vars, but avoid sending junk we don't need. |
380 | 380 | if ( $include_value ) { |
381 | - $datas[ $key ] = $value; |
|
381 | + $datas[$key] = $value; |
|
382 | 382 | } |
383 | 383 | unset( $key, $value ); |
384 | 384 | } |
@@ -90,7 +90,8 @@ |
||
90 | 90 | |
91 | 91 | if ( $posted_field->required == '1' && FrmAppHelper::is_empty_value( $value ) ) { |
92 | 92 | $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $posted_field, 'blank' ); |
93 | - } elseif ( $posted_field->type == 'text' && ! isset( $_POST['item_name'] ) ) { // WPCS: CSRF ok. |
|
93 | + } elseif ( $posted_field->type == 'text' && ! isset( $_POST['item_name'] ) ) { |
|
94 | +// WPCS: CSRF ok. |
|
94 | 95 | $_POST['item_name'] = $value; |
95 | 96 | } |
96 | 97 |
@@ -47,6 +47,9 @@ discard block |
||
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
50 | + /** |
|
51 | + * @param boolean $exclude |
|
52 | + */ |
|
50 | 53 | private static function get_fields_to_validate( $values, $exclude ) { |
51 | 54 | $where = apply_filters( 'frm_posted_field_ids', array( 'fi.form_id' => $values['form_id'] ) ); |
52 | 55 | |
@@ -243,7 +246,7 @@ discard block |
||
243 | 246 | |
244 | 247 | /** |
245 | 248 | * @param int $form_id |
246 | - * @return boolean |
|
249 | + * @return boolean|string |
|
247 | 250 | */ |
248 | 251 | private static function is_antispam_check( $form_id ) { |
249 | 252 | $aspm = new FrmAntiSpam( $form_id ); |
@@ -310,6 +313,9 @@ discard block |
||
310 | 313 | * For WP 5.5 compatibility. |
311 | 314 | * |
312 | 315 | * @since 4.06.02 |
316 | + * @param string $content |
|
317 | + * @param string $ip |
|
318 | + * @param string $user_agent |
|
313 | 319 | */ |
314 | 320 | private static function check_disallowed_words( $author, $email, $url, $content, $ip, $user_agent ) { |
315 | 321 | if ( function_exists( 'wp_check_comment_disallowed_list' ) ) { |
@@ -323,6 +329,7 @@ discard block |
||
323 | 329 | * For WP 5.5 compatibility. |
324 | 330 | * |
325 | 331 | * @since 4.06.02 |
332 | + * @return string |
|
326 | 333 | */ |
327 | 334 | private static function get_disallowed_words() { |
328 | 335 | $keys = get_option( 'disallowed_keys' ); |
@@ -59,8 +59,8 @@ |
||
59 | 59 | protected function init_saved_value( $entry ) { |
60 | 60 | if ( $this->field->type === 'html' ) { |
61 | 61 | $this->saved_value = $this->field->description; |
62 | - } elseif ( isset( $entry->metas[ $this->field->id ] ) ) { |
|
63 | - $this->saved_value = $entry->metas[ $this->field->id ]; |
|
62 | + } elseif ( isset( $entry->metas[$this->field->id] ) ) { |
|
63 | + $this->saved_value = $entry->metas[$this->field->id]; |
|
64 | 64 | } else { |
65 | 65 | $this->saved_value = ''; |
66 | 66 | } |
@@ -22,7 +22,7 @@ |
||
22 | 22 | if ( isset( $values['fields'] ) && ! empty( $values['fields'] ) ) { |
23 | 23 | $values['count'] = 0; |
24 | 24 | foreach ( $values['fields'] as $field ) { |
25 | - $values['count']++; |
|
25 | + $values['count'] ++; |
|
26 | 26 | FrmFieldsController::load_single_field( $field, $values ); |
27 | 27 | unset( $field ); |
28 | 28 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $event_labels = FrmFormAction::trigger_labels(); |
37 | 37 | foreach ( $action_control->action_options['event'] as $event ) { |
38 | 38 | ?> |
39 | - <option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event ); ?></option> |
|
39 | + <option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( isset( $event_labels[$event] ) ? $event_labels[$event] : $event ); ?></option> |
|
40 | 40 | <?php } ?> |
41 | 41 | </select> |
42 | 42 | </p> |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | class FrmDefPostAction extends FrmFormAction { |
4 | 4 | public function __construct() { |
5 | 5 | $action_ops = FrmFormAction::default_action_opts( 'frm_wordpress_icon frm-inverse frm_show_upgrade' ); |
6 | - $action_ops['color'] = 'rgb(0,160,210)'; |
|
6 | + $action_ops['color'] = 'rgb(0,160,210)'; |
|
7 | 7 | |
8 | 8 | parent::__construct( 'wppost', __( 'Create Post', 'formidable' ), $action_ops ); |
9 | 9 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | class FrmDefMlcmpAction extends FrmFormAction { |
43 | 43 | public function __construct() { |
44 | 44 | $action_ops = FrmFormAction::default_action_opts( 'frm_mailchimp_icon frm_show_upgrade frm-inverse' ); |
45 | - $action_ops['color'] = 'var(--dark-grey)'; |
|
45 | + $action_ops['color'] = 'var(--dark-grey)'; |
|
46 | 46 | |
47 | 47 | parent::__construct( 'mailchimp', 'MailChimp', $action_ops ); |
48 | 48 | } |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | } |
297 | 297 | |
298 | 298 | public static function get_banner_tip() { |
299 | - $tips = array( |
|
299 | + $tips = array( |
|
300 | 300 | array( |
301 | 301 | 'link' => array( |
302 | 302 | 'medium' => 'banner', |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | ), |
324 | 324 | ); |
325 | 325 | $random = rand( 0, count( $tips ) - 1 ); |
326 | - $tip = $tips[ $random ]; |
|
326 | + $tip = $tips[$random]; |
|
327 | 327 | $tip['num'] = $random; |
328 | 328 | |
329 | 329 | return $tip; |
@@ -332,6 +332,6 @@ discard block |
||
332 | 332 | public static function get_random_tip( $tips ) { |
333 | 333 | $random = rand( 0, count( $tips ) - 1 ); |
334 | 334 | |
335 | - return $tips[ $random ]; |
|
335 | + return $tips[$random]; |
|
336 | 336 | } |
337 | 337 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $page = $this->get_pagenum(); |
19 | 19 | $per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' ); |
20 | 20 | |
21 | - $mode = self::get_param( |
|
21 | + $mode = self::get_param( |
|
22 | 22 | array( |
23 | 23 | 'param' => 'mode', |
24 | 24 | 'default' => 'list', |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | 'default' => 'name', |
31 | 31 | ) |
32 | 32 | ); |
33 | - $order = self::get_param( |
|
33 | + $order = self::get_param( |
|
34 | 34 | array( |
35 | 35 | 'param' => 'order', |
36 | 36 | 'default' => 'ASC', |
37 | 37 | ) |
38 | 38 | ); |
39 | - $start = self::get_param( |
|
39 | + $start = self::get_param( |
|
40 | 40 | array( |
41 | 41 | 'param' => 'start', |
42 | 42 | 'default' => ( $page - 1 ) * $per_page, |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | |
178 | 178 | if ( $counts->{$status} || 'draft' !== $status ) { |
179 | 179 | /* translators: %1$s: Status, %2$s: Number of items */ |
180 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
180 | + $links[$status] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | unset( $status, $name ); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | private function get_actions( &$actions, $item, $edit_link ) { |
283 | 283 | $new_actions = FrmFormsHelper::get_action_links( $item->id, $item ); |
284 | 284 | foreach ( $new_actions as $link => $action ) { |
285 | - $new_actions[ $link ] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
285 | + $new_actions[$link] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | if ( 'trash' == $this->status ) { |