@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | // Check if isset is negated with "!". |
| 47 | 47 | $prevToken = $phpcsFile->findPrevious( T_WHITESPACE, $stackPtr - 1, null, true ); |
| 48 | 48 | |
| 49 | - if ( false === $prevToken || $tokens[ $prevToken ]['code'] !== T_BOOLEAN_NOT ) { |
|
| 49 | + if ( false === $prevToken || $tokens[$prevToken]['code'] !== T_BOOLEAN_NOT ) { |
|
| 50 | 50 | return; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -55,15 +55,15 @@ discard block |
||
| 55 | 55 | // Find the opening parenthesis after isset. |
| 56 | 56 | $issetOpenParen = $phpcsFile->findNext( T_WHITESPACE, $stackPtr + 1, null, true ); |
| 57 | 57 | |
| 58 | - if ( false === $issetOpenParen || $tokens[ $issetOpenParen ]['code'] !== T_OPEN_PARENTHESIS ) { |
|
| 58 | + if ( false === $issetOpenParen || $tokens[$issetOpenParen]['code'] !== T_OPEN_PARENTHESIS ) { |
|
| 59 | 59 | return; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - if ( ! isset( $tokens[ $issetOpenParen ]['parenthesis_closer'] ) ) { |
|
| 62 | + if ( ! isset( $tokens[$issetOpenParen]['parenthesis_closer'] ) ) { |
|
| 63 | 63 | return; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - $issetCloseParen = $tokens[ $issetOpenParen ]['parenthesis_closer']; |
|
| 66 | + $issetCloseParen = $tokens[$issetOpenParen]['parenthesis_closer']; |
|
| 67 | 67 | |
| 68 | 68 | // Get the variable/expression inside isset(). |
| 69 | 69 | $issetContent = $this->getParenthesesContent( $phpcsFile, $issetOpenParen, $issetCloseParen ); |
@@ -75,14 +75,14 @@ discard block |
||
| 75 | 75 | // Find the || operator after isset(). |
| 76 | 76 | $orOperator = $phpcsFile->findNext( T_WHITESPACE, $issetCloseParen + 1, null, true ); |
| 77 | 77 | |
| 78 | - if ( false === $orOperator || $tokens[ $orOperator ]['code'] !== T_BOOLEAN_OR ) { |
|
| 78 | + if ( false === $orOperator || $tokens[$orOperator]['code'] !== T_BOOLEAN_OR ) { |
|
| 79 | 79 | return; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | // Find the "!" after ||. |
| 83 | 83 | $secondNot = $phpcsFile->findNext( T_WHITESPACE, $orOperator + 1, null, true ); |
| 84 | 84 | |
| 85 | - if ( false === $secondNot || $tokens[ $secondNot ]['code'] !== T_BOOLEAN_NOT ) { |
|
| 85 | + if ( false === $secondNot || $tokens[$secondNot]['code'] !== T_BOOLEAN_NOT ) { |
|
| 86 | 86 | return; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | $phpcsFile->fixer->replaceToken( $notToken, '' ); |
| 116 | 116 | |
| 117 | 117 | // Remove whitespace between "!" and "isset". |
| 118 | - for ( $i = $notToken + 1; $i < $stackPtr; $i++ ) { |
|
| 119 | - if ( $tokens[ $i ]['code'] === T_WHITESPACE ) { |
|
| 118 | + for ( $i = $notToken + 1; $i < $stackPtr; $i ++ ) { |
|
| 119 | + if ( $tokens[$i]['code'] === T_WHITESPACE ) { |
|
| 120 | 120 | $phpcsFile->fixer->replaceToken( $i, '' ); |
| 121 | 121 | } |
| 122 | 122 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | // Remove everything from after isset's closing paren to end of second expression. |
| 128 | 128 | $endToken = $secondContent['end']; |
| 129 | 129 | |
| 130 | - for ( $i = $issetCloseParen + 1; $i <= $endToken; $i++ ) { |
|
| 130 | + for ( $i = $issetCloseParen + 1; $i <= $endToken; $i ++ ) { |
|
| 131 | 131 | $phpcsFile->fixer->replaceToken( $i, '' ); |
| 132 | 132 | } |
| 133 | 133 | |
@@ -150,8 +150,8 @@ discard block |
||
| 150 | 150 | $start = null; |
| 151 | 151 | $end = null; |
| 152 | 152 | |
| 153 | - for ( $i = $openParen + 1; $i < $closeParen; $i++ ) { |
|
| 154 | - if ( $tokens[ $i ]['code'] === T_WHITESPACE ) { |
|
| 153 | + for ( $i = $openParen + 1; $i < $closeParen; $i ++ ) { |
|
| 154 | + if ( $tokens[$i]['code'] === T_WHITESPACE ) { |
|
| 155 | 155 | continue; |
| 156 | 156 | } |
| 157 | 157 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | $end = $i; |
| 163 | - $content .= $tokens[ $i ]['content']; |
|
| 163 | + $content .= $tokens[$i]['content']; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | if ( empty( $content ) ) { |
@@ -203,8 +203,8 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | $bracketDepth = 0; |
| 205 | 205 | |
| 206 | - for ( $i = $startPtr; $i < count( $tokens ); $i++ ) { |
|
| 207 | - $code = $tokens[ $i ]['code']; |
|
| 206 | + for ( $i = $startPtr; $i < count( $tokens ); $i ++ ) { |
|
| 207 | + $code = $tokens[$i]['code']; |
|
| 208 | 208 | |
| 209 | 209 | // Skip whitespace. |
| 210 | 210 | if ( $code === T_WHITESPACE ) { |
@@ -213,22 +213,22 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | // Track bracket depth. |
| 215 | 215 | if ( $code === T_OPEN_SQUARE_BRACKET ) { |
| 216 | - ++$bracketDepth; |
|
| 217 | - $content .= $tokens[ $i ]['content']; |
|
| 216 | + ++ $bracketDepth; |
|
| 217 | + $content .= $tokens[$i]['content']; |
|
| 218 | 218 | $end = $i; |
| 219 | 219 | continue; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if ( $code === T_CLOSE_SQUARE_BRACKET ) { |
| 223 | - --$bracketDepth; |
|
| 224 | - $content .= $tokens[ $i ]['content']; |
|
| 223 | + -- $bracketDepth; |
|
| 224 | + $content .= $tokens[$i]['content']; |
|
| 225 | 225 | $end = $i; |
| 226 | 226 | continue; |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | // If we're inside brackets, accept more token types. |
| 230 | 230 | if ( $bracketDepth > 0 ) { |
| 231 | - $content .= $tokens[ $i ]['content']; |
|
| 231 | + $content .= $tokens[$i]['content']; |
|
| 232 | 232 | $end = $i; |
| 233 | 233 | continue; |
| 234 | 234 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | break; |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | - $content .= $tokens[ $i ]['content']; |
|
| 241 | + $content .= $tokens[$i]['content']; |
|
| 242 | 242 | $end = $i; |
| 243 | 243 | } |
| 244 | 244 | |
@@ -46,22 +46,22 @@ discard block |
||
| 46 | 46 | // Check that isset is NOT negated (we want `isset()` not `! isset()`). |
| 47 | 47 | $prevToken = $phpcsFile->findPrevious( T_WHITESPACE, $stackPtr - 1, null, true ); |
| 48 | 48 | |
| 49 | - if ( false !== $prevToken && $tokens[ $prevToken ]['code'] === T_BOOLEAN_NOT ) { |
|
| 49 | + if ( false !== $prevToken && $tokens[$prevToken]['code'] === T_BOOLEAN_NOT ) { |
|
| 50 | 50 | return; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Find the opening parenthesis after isset. |
| 54 | 54 | $issetOpenParen = $phpcsFile->findNext( T_WHITESPACE, $stackPtr + 1, null, true ); |
| 55 | 55 | |
| 56 | - if ( false === $issetOpenParen || $tokens[ $issetOpenParen ]['code'] !== T_OPEN_PARENTHESIS ) { |
|
| 56 | + if ( false === $issetOpenParen || $tokens[$issetOpenParen]['code'] !== T_OPEN_PARENTHESIS ) { |
|
| 57 | 57 | return; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - if ( ! isset( $tokens[ $issetOpenParen ]['parenthesis_closer'] ) ) { |
|
| 60 | + if ( ! isset( $tokens[$issetOpenParen]['parenthesis_closer'] ) ) { |
|
| 61 | 61 | return; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $issetCloseParen = $tokens[ $issetOpenParen ]['parenthesis_closer']; |
|
| 64 | + $issetCloseParen = $tokens[$issetOpenParen]['parenthesis_closer']; |
|
| 65 | 65 | |
| 66 | 66 | // Get the variable/expression inside isset(). |
| 67 | 67 | $issetContent = $this->getParenthesesContent( $phpcsFile, $issetOpenParen, $issetCloseParen ); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | // Find the && operator after isset(). |
| 74 | 74 | $andOperator = $phpcsFile->findNext( T_WHITESPACE, $issetCloseParen + 1, null, true ); |
| 75 | 75 | |
| 76 | - if ( false === $andOperator || $tokens[ $andOperator ]['code'] !== T_BOOLEAN_AND ) { |
|
| 76 | + if ( false === $andOperator || $tokens[$andOperator]['code'] !== T_BOOLEAN_AND ) { |
|
| 77 | 77 | return; |
| 78 | 78 | } |
| 79 | 79 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | T_SPACESHIP, |
| 109 | 109 | ); |
| 110 | 110 | |
| 111 | - if ( in_array( $tokens[ $afterSecondVar ]['code'], $comparisonOperators, true ) ) { |
|
| 111 | + if ( in_array( $tokens[$afterSecondVar]['code'], $comparisonOperators, true ) ) { |
|
| 112 | 112 | return; |
| 113 | 113 | } |
| 114 | 114 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | // Remove everything from after isset's closing paren to end of second expression. |
| 131 | 131 | $endToken = $secondContent['end']; |
| 132 | 132 | |
| 133 | - for ( $i = $issetCloseParen + 1; $i <= $endToken; $i++ ) { |
|
| 133 | + for ( $i = $issetCloseParen + 1; $i <= $endToken; $i ++ ) { |
|
| 134 | 134 | $phpcsFile->fixer->replaceToken( $i, '' ); |
| 135 | 135 | } |
| 136 | 136 | |
@@ -153,8 +153,8 @@ discard block |
||
| 153 | 153 | $start = null; |
| 154 | 154 | $end = null; |
| 155 | 155 | |
| 156 | - for ( $i = $openParen + 1; $i < $closeParen; $i++ ) { |
|
| 157 | - if ( $tokens[ $i ]['code'] === T_WHITESPACE ) { |
|
| 156 | + for ( $i = $openParen + 1; $i < $closeParen; $i ++ ) { |
|
| 157 | + if ( $tokens[$i]['code'] === T_WHITESPACE ) { |
|
| 158 | 158 | continue; |
| 159 | 159 | } |
| 160 | 160 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | $end = $i; |
| 166 | - $content .= $tokens[ $i ]['content']; |
|
| 166 | + $content .= $tokens[$i]['content']; |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | if ( empty( $content ) ) { |
@@ -206,8 +206,8 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | $bracketDepth = 0; |
| 208 | 208 | |
| 209 | - for ( $i = $startPtr; $i < count( $tokens ); $i++ ) { |
|
| 210 | - $code = $tokens[ $i ]['code']; |
|
| 209 | + for ( $i = $startPtr; $i < count( $tokens ); $i ++ ) { |
|
| 210 | + $code = $tokens[$i]['code']; |
|
| 211 | 211 | |
| 212 | 212 | // Skip whitespace. |
| 213 | 213 | if ( $code === T_WHITESPACE ) { |
@@ -216,22 +216,22 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | // Track bracket depth. |
| 218 | 218 | if ( $code === T_OPEN_SQUARE_BRACKET ) { |
| 219 | - ++$bracketDepth; |
|
| 220 | - $content .= $tokens[ $i ]['content']; |
|
| 219 | + ++ $bracketDepth; |
|
| 220 | + $content .= $tokens[$i]['content']; |
|
| 221 | 221 | $end = $i; |
| 222 | 222 | continue; |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | if ( $code === T_CLOSE_SQUARE_BRACKET ) { |
| 226 | - --$bracketDepth; |
|
| 227 | - $content .= $tokens[ $i ]['content']; |
|
| 226 | + -- $bracketDepth; |
|
| 227 | + $content .= $tokens[$i]['content']; |
|
| 228 | 228 | $end = $i; |
| 229 | 229 | continue; |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | // If we're inside brackets, accept more token types. |
| 233 | 233 | if ( $bracketDepth > 0 ) { |
| 234 | - $content .= $tokens[ $i ]['content']; |
|
| 234 | + $content .= $tokens[$i]['content']; |
|
| 235 | 235 | $end = $i; |
| 236 | 236 | continue; |
| 237 | 237 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | break; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - $content .= $tokens[ $i ]['content']; |
|
| 244 | + $content .= $tokens[$i]['content']; |
|
| 245 | 245 | $end = $i; |
| 246 | 246 | } |
| 247 | 247 | |
@@ -363,11 +363,11 @@ discard block |
||
| 363 | 363 | 'coupon' => '2026-01-13', |
| 364 | 364 | ); |
| 365 | 365 | |
| 366 | - if ( ! isset( $release_dates[ $type ] ) ) { |
|
| 366 | + if ( ! isset( $release_dates[$type] ) ) { |
|
| 367 | 367 | return false; |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | - $release_date = $release_dates[ $type ]; |
|
| 370 | + $release_date = $release_dates[$type]; |
|
| 371 | 371 | |
| 372 | 372 | $three_months_after_release = gmdate( 'Y-m-d', strtotime( $release_date . ' + 90 days' ) ); |
| 373 | 373 | return gmdate( 'Y-m-d' ) < $three_months_after_release; |
@@ -401,8 +401,8 @@ discard block |
||
| 401 | 401 | $values = FrmAppHelper::maybe_filter_array( $values, array( 'name', 'description' ) ); |
| 402 | 402 | |
| 403 | 403 | foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) { |
| 404 | - if ( isset( $values[ $col ] ) ) { |
|
| 405 | - $new_values[ $col ] = $values[ $col ]; |
|
| 404 | + if ( isset( $values[$col] ) ) { |
|
| 405 | + $new_values[$col] = $values[$col]; |
|
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | $new_values['created_at'] = current_time( 'mysql', 1 ); |
| 415 | 415 | |
| 416 | 416 | if ( isset( $values['id'] ) ) { |
| 417 | - $frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key']; |
|
| 417 | + $frm_duplicate_ids[$values['field_key']] = $new_values['field_key']; |
|
| 418 | 418 | $new_values = apply_filters( 'frm_duplicated_field', $new_values ); |
| 419 | 419 | } |
| 420 | 420 | |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | |
| 423 | 423 | foreach ( $new_values as $k => $v ) { |
| 424 | 424 | if ( is_array( $v ) ) { |
| 425 | - $new_values[ $k ] = $k === 'default_value' ? FrmAppHelper::maybe_json_encode( $v ) : serialize( $v ); |
|
| 425 | + $new_values[$k] = $k === 'default_value' ? FrmAppHelper::maybe_json_encode( $v ) : serialize( $v ); |
|
| 426 | 426 | } |
| 427 | 427 | unset( $k, $v ); |
| 428 | 428 | } |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | if ( isset( $values['id'] ) ) { |
| 444 | - $frm_duplicate_ids[ $values['id'] ] = $new_id; |
|
| 444 | + $frm_duplicate_ids[$values['id']] = $new_id; |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | return $new_id; |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | * |
| 496 | 496 | * @return string |
| 497 | 497 | */ |
| 498 | - function ( $match ) { |
|
| 498 | + function( $match ) { |
|
| 499 | 499 | $attr = shortcode_parse_atts( $match[3] ); |
| 500 | 500 | |
| 501 | 501 | if ( ! is_array( $attr ) ) { |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | if ( FrmAppHelper::input_key_is_safe( $key, 'update' ) ) { |
| 526 | - $safe_atts[ $key ] = $value; |
|
| 526 | + $safe_atts[$key] = $value; |
|
| 527 | 527 | } |
| 528 | 528 | }//end foreach |
| 529 | 529 | |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) { |
| 596 | 596 | global $frm_duplicate_ids; |
| 597 | 597 | |
| 598 | - $where = array( |
|
| 598 | + $where = array( |
|
| 599 | 599 | array( |
| 600 | 600 | 'or' => 1, |
| 601 | 601 | 'fi.form_id' => $old_form_id, |
@@ -644,8 +644,8 @@ discard block |
||
| 644 | 644 | |
| 645 | 645 | $values = apply_filters( 'frm_duplicated_field', $values ); |
| 646 | 646 | $new_id = self::create( $values ); |
| 647 | - $frm_duplicate_ids[ $field->id ] = $new_id; |
|
| 648 | - $frm_duplicate_ids[ $field->field_key ] = $new_id; |
|
| 647 | + $frm_duplicate_ids[$field->id] = $new_id; |
|
| 648 | + $frm_duplicate_ids[$field->field_key] = $new_id; |
|
| 649 | 649 | unset( $field ); |
| 650 | 650 | }//end foreach |
| 651 | 651 | } |
@@ -695,11 +695,11 @@ discard block |
||
| 695 | 695 | |
| 696 | 696 | // serialize array values |
| 697 | 697 | foreach ( array( 'field_options', 'options' ) as $opt ) { |
| 698 | - if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) { |
|
| 698 | + if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) { |
|
| 699 | 699 | if ( 'field_options' === $opt ) { |
| 700 | - $values[ $opt ] = self::maybe_filter_options( $values[ $opt ] ); |
|
| 700 | + $values[$opt] = self::maybe_filter_options( $values[$opt] ); |
|
| 701 | 701 | } |
| 702 | - $values[ $opt ] = serialize( $values[ $opt ] ); |
|
| 702 | + $values[$opt] = serialize( $values[$opt] ); |
|
| 703 | 703 | } |
| 704 | 704 | } |
| 705 | 705 | |
@@ -912,8 +912,8 @@ discard block |
||
| 912 | 912 | continue; |
| 913 | 913 | } |
| 914 | 914 | |
| 915 | - $fields[ $result->id ] = $result; |
|
| 916 | - ++$count; |
|
| 915 | + $fields[$result->id] = $result; |
|
| 916 | + ++ $count; |
|
| 917 | 917 | |
| 918 | 918 | // phpcs:ignore Universal.Operators.StrictComparisons |
| 919 | 919 | if ( $limit == 1 ) { |
@@ -969,8 +969,8 @@ discard block |
||
| 969 | 969 | $count = 0; |
| 970 | 970 | |
| 971 | 971 | foreach ( $results as $result ) { |
| 972 | - ++$count; |
|
| 973 | - $fields[ $result->id ] = $result; |
|
| 972 | + ++ $count; |
|
| 973 | + $fields[$result->id] = $result; |
|
| 974 | 974 | |
| 975 | 975 | if ( $limit && $count >= $limit ) { |
| 976 | 976 | break; |
@@ -1103,7 +1103,7 @@ discard block |
||
| 1103 | 1103 | $query_type = $limit === ' LIMIT 1' || $limit == 1 ? 'row' : 'results'; // phpcs:ignore Universal.Operators.StrictComparisons |
| 1104 | 1104 | |
| 1105 | 1105 | if ( is_array( $where ) ) { |
| 1106 | - $args = array( |
|
| 1106 | + $args = array( |
|
| 1107 | 1107 | 'order_by' => $order_by, |
| 1108 | 1108 | 'limit' => $limit, |
| 1109 | 1109 | ); |
@@ -1140,9 +1140,9 @@ discard block |
||
| 1140 | 1140 | FrmDb::set_cache( $result->field_key, $result, 'frm_field' ); |
| 1141 | 1141 | |
| 1142 | 1142 | self::prepare_options( $result ); |
| 1143 | - $results[ $r_key ]->field_options = $result->field_options; |
|
| 1144 | - $results[ $r_key ]->options = $result->options; |
|
| 1145 | - $results[ $r_key ]->default_value = $result->default_value; |
|
| 1143 | + $results[$r_key]->field_options = $result->field_options; |
|
| 1144 | + $results[$r_key]->options = $result->options; |
|
| 1145 | + $results[$r_key]->default_value = $result->default_value; |
|
| 1146 | 1146 | |
| 1147 | 1147 | unset( $r_key, $result ); |
| 1148 | 1148 | } |
@@ -1238,7 +1238,7 @@ discard block |
||
| 1238 | 1238 | |
| 1239 | 1239 | if ( count( $next_fields ) >= self::$transient_size ) { |
| 1240 | 1240 | // if this transient is full, check for another |
| 1241 | - ++$next; |
|
| 1241 | + ++ $next; |
|
| 1242 | 1242 | self::get_next_transient( $fields, $base_name, $next ); |
| 1243 | 1243 | } |
| 1244 | 1244 | } |
@@ -1274,7 +1274,7 @@ discard block |
||
| 1274 | 1274 | return; |
| 1275 | 1275 | } |
| 1276 | 1276 | |
| 1277 | - ++$next; |
|
| 1277 | + ++ $next; |
|
| 1278 | 1278 | } |
| 1279 | 1279 | } |
| 1280 | 1280 | |
@@ -1430,7 +1430,7 @@ discard block |
||
| 1430 | 1430 | * @return bool |
| 1431 | 1431 | */ |
| 1432 | 1432 | public static function is_option_true_in_array( $field, $option ) { |
| 1433 | - return ! empty( $field[ $option ] ); |
|
| 1433 | + return ! empty( $field[$option] ); |
|
| 1434 | 1434 | } |
| 1435 | 1435 | |
| 1436 | 1436 | /** |
@@ -1440,7 +1440,7 @@ discard block |
||
| 1440 | 1440 | * @return bool |
| 1441 | 1441 | */ |
| 1442 | 1442 | public static function is_option_true_in_object( $field, $option ) { |
| 1443 | - return ! empty( $field->field_options[ $option ] ); |
|
| 1443 | + return ! empty( $field->field_options[$option] ); |
|
| 1444 | 1444 | } |
| 1445 | 1445 | |
| 1446 | 1446 | /** |
@@ -1450,7 +1450,7 @@ discard block |
||
| 1450 | 1450 | * @return bool |
| 1451 | 1451 | */ |
| 1452 | 1452 | public static function is_option_empty_in_array( $field, $option ) { |
| 1453 | - return empty( $field[ $option ] ); |
|
| 1453 | + return empty( $field[$option] ); |
|
| 1454 | 1454 | } |
| 1455 | 1455 | |
| 1456 | 1456 | /** |
@@ -1460,7 +1460,7 @@ discard block |
||
| 1460 | 1460 | * @return bool |
| 1461 | 1461 | */ |
| 1462 | 1462 | public static function is_option_empty_in_object( $field, $option ) { |
| 1463 | - return empty( $field->field_options[ $option ] ); |
|
| 1463 | + return empty( $field->field_options[$option] ); |
|
| 1464 | 1464 | } |
| 1465 | 1465 | |
| 1466 | 1466 | /** |
@@ -1470,7 +1470,7 @@ discard block |
||
| 1470 | 1470 | * @return bool |
| 1471 | 1471 | */ |
| 1472 | 1472 | public static function is_option_value_in_object( $field, $option ) { |
| 1473 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != ''; // phpcs:ignore Universal.Operators.StrictComparisons |
|
| 1473 | + return isset( $field->field_options[$option] ) && $field->field_options[$option] != ''; // phpcs:ignore Universal.Operators.StrictComparisons |
|
| 1474 | 1474 | } |
| 1475 | 1475 | |
| 1476 | 1476 | /** |
@@ -1492,10 +1492,10 @@ discard block |
||
| 1492 | 1492 | * @return mixed |
| 1493 | 1493 | */ |
| 1494 | 1494 | public static function get_option_in_array( $field, $option ) { |
| 1495 | - if ( isset( $field[ $option ] ) ) { |
|
| 1496 | - $this_option = $field[ $option ]; |
|
| 1497 | - } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) { |
|
| 1498 | - $this_option = $field['field_options'][ $option ]; |
|
| 1495 | + if ( isset( $field[$option] ) ) { |
|
| 1496 | + $this_option = $field[$option]; |
|
| 1497 | + } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) { |
|
| 1498 | + $this_option = $field['field_options'][$option]; |
|
| 1499 | 1499 | } else { |
| 1500 | 1500 | $this_option = ''; |
| 1501 | 1501 | } |
@@ -1510,7 +1510,7 @@ discard block |
||
| 1510 | 1510 | * @return mixed |
| 1511 | 1511 | */ |
| 1512 | 1512 | public static function get_option_in_object( $field, $option ) { |
| 1513 | - return $field->field_options[ $option ] ?? ''; |
|
| 1513 | + return $field->field_options[$option] ?? ''; |
|
| 1514 | 1514 | } |
| 1515 | 1515 | |
| 1516 | 1516 | /** |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | 'fill' => '#4d4d4d', |
| 331 | 331 | 'orange' => '#f05a24', |
| 332 | 332 | ); |
| 333 | - $atts = array_merge( $defaults, $atts ); |
|
| 333 | + $atts = array_merge( $defaults, $atts ); |
|
| 334 | 334 | |
| 335 | 335 | 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'] ) . '"> |
| 336 | 336 | <path fill="' . esc_attr( $atts['orange'] ) . '" d="M289.6 384h140v76h-140z"/> |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | * @return string |
| 630 | 630 | */ |
| 631 | 631 | public static function get_server_value( $value ) { |
| 632 | - return isset( $_SERVER[ $value ] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[ $value ] ) ) : ''; |
|
| 632 | + return isset( $_SERVER[$value] ) ? wp_strip_all_tags( wp_unslash( $_SERVER[$value] ) ) : ''; |
|
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | /** |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | $ip = ''; |
| 664 | 664 | |
| 665 | 665 | foreach ( $ip_options as $key ) { |
| 666 | - if ( ! isset( $_SERVER[ $key ] ) ) { |
|
| 666 | + if ( ! isset( $_SERVER[$key] ) ) { |
|
| 667 | 667 | continue; |
| 668 | 668 | } |
| 669 | 669 | |
@@ -741,11 +741,11 @@ discard block |
||
| 741 | 741 | } |
| 742 | 742 | |
| 743 | 743 | if ( $src === 'get' ) { |
| 744 | - $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 |
|
| 744 | + $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 |
|
| 745 | 745 | |
| 746 | - if ( ! isset( $_POST[ $param ] ) && isset( $_GET[ $param ] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 746 | + if ( ! isset( $_POST[$param] ) && isset( $_GET[$param] ) && ! is_array( $value ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 747 | 747 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 748 | - $value = htmlspecialchars_decode( wp_unslash( $_GET[ $param ] ) ); |
|
| 748 | + $value = htmlspecialchars_decode( wp_unslash( $_GET[$param] ) ); |
|
| 749 | 749 | } |
| 750 | 750 | self::sanitize_value( $sanitize, $value ); |
| 751 | 751 | } else { |
@@ -766,7 +766,7 @@ discard block |
||
| 766 | 766 | } |
| 767 | 767 | |
| 768 | 768 | $p = trim( $p, ']' ); |
| 769 | - $value = $value[ $p ] ?? $default; |
|
| 769 | + $value = $value[$p] ?? $default; |
|
| 770 | 770 | } |
| 771 | 771 | } |
| 772 | 772 | |
@@ -832,28 +832,28 @@ discard block |
||
| 832 | 832 | 'sanitize' => 'sanitize_text_field', |
| 833 | 833 | 'serialized' => false, |
| 834 | 834 | ); |
| 835 | - $args = wp_parse_args( $args, $defaults ); |
|
| 835 | + $args = wp_parse_args( $args, $defaults ); |
|
| 836 | 836 | |
| 837 | 837 | $value = $args['default']; |
| 838 | 838 | |
| 839 | 839 | if ( $args['type'] === 'get' ) { |
| 840 | - if ( $_GET && isset( $_GET[ $args['param'] ] ) ) { |
|
| 840 | + if ( $_GET && isset( $_GET[$args['param']] ) ) { |
|
| 841 | 841 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
| 842 | - $value = wp_unslash( $_GET[ $args['param'] ] ); |
|
| 842 | + $value = wp_unslash( $_GET[$args['param']] ); |
|
| 843 | 843 | } |
| 844 | 844 | } elseif ( $args['type'] === 'post' ) { |
| 845 | - if ( isset( $_POST[ $args['param'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 845 | + if ( isset( $_POST[$args['param']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 846 | 846 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
| 847 | - $value = wp_unslash( $_POST[ $args['param'] ] ); |
|
| 847 | + $value = wp_unslash( $_POST[$args['param']] ); |
|
| 848 | 848 | |
| 849 | 849 | if ( $args['serialized'] === true && is_serialized_string( $value ) && is_serialized( $value ) ) { |
| 850 | 850 | self::unserialize_or_decode( $value ); |
| 851 | 851 | } |
| 852 | 852 | } |
| 853 | - } elseif ( isset( $_REQUEST[ $args['param'] ] ) ) { |
|
| 853 | + } elseif ( isset( $_REQUEST[$args['param']] ) ) { |
|
| 854 | 854 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 855 | 855 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 856 | - $value = wp_unslash( $_REQUEST[ $args['param'] ] ); |
|
| 856 | + $value = wp_unslash( $_REQUEST[$args['param']] ); |
|
| 857 | 857 | } |
| 858 | 858 | |
| 859 | 859 | self::sanitize_value( $args['sanitize'], $value ); |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | $temp_values = $value; |
| 903 | 903 | |
| 904 | 904 | foreach ( $temp_values as $k => $v ) { |
| 905 | - self::sanitize_value( $sanitize, $value[ $k ] ); |
|
| 905 | + self::sanitize_value( $sanitize, $value[$k] ); |
|
| 906 | 906 | } |
| 907 | 907 | |
| 908 | 908 | return; |
@@ -921,8 +921,8 @@ discard block |
||
| 921 | 921 | $temp_values = $values; |
| 922 | 922 | |
| 923 | 923 | foreach ( $temp_values as $k => $val ) { |
| 924 | - if ( isset( $sanitize_method[ $k ] ) ) { |
|
| 925 | - $values[ $k ] = call_user_func( $sanitize_method[ $k ], $val ); |
|
| 924 | + if ( isset( $sanitize_method[$k] ) ) { |
|
| 925 | + $values[$k] = call_user_func( $sanitize_method[$k], $val ); |
|
| 926 | 926 | } |
| 927 | 927 | } |
| 928 | 928 | } |
@@ -986,7 +986,7 @@ discard block |
||
| 986 | 986 | $temp_values = $value; |
| 987 | 987 | |
| 988 | 988 | foreach ( $temp_values as $k => $v ) { |
| 989 | - self::decode_specialchars( $value[ $k ] ); |
|
| 989 | + self::decode_specialchars( $value[$k] ); |
|
| 990 | 990 | } |
| 991 | 991 | } else { |
| 992 | 992 | self::decode_amp( $value ); |
@@ -1129,7 +1129,7 @@ discard block |
||
| 1129 | 1129 | * @return array |
| 1130 | 1130 | */ |
| 1131 | 1131 | public static function add_allowed_submit_button_tags( $allowed_html ) { |
| 1132 | - $allowed_html['input'] = array( |
|
| 1132 | + $allowed_html['input'] = array( |
|
| 1133 | 1133 | 'type' => true, |
| 1134 | 1134 | 'value' => true, |
| 1135 | 1135 | 'formnovalidate' => true, |
@@ -1157,7 +1157,7 @@ discard block |
||
| 1157 | 1157 | $allowed_html = $html; |
| 1158 | 1158 | } elseif ( $allowed ) { |
| 1159 | 1159 | foreach ( (array) $allowed as $a ) { |
| 1160 | - $allowed_html[ $a ] = $html[ $a ] ?? array(); |
|
| 1160 | + $allowed_html[$a] = $html[$a] ?? array(); |
|
| 1161 | 1161 | } |
| 1162 | 1162 | } |
| 1163 | 1163 | |
@@ -1349,8 +1349,8 @@ discard block |
||
| 1349 | 1349 | |
| 1350 | 1350 | global $wp_query; |
| 1351 | 1351 | |
| 1352 | - if ( isset( $wp_query->query_vars[ $param ] ) ) { |
|
| 1353 | - $value = $wp_query->query_vars[ $param ]; |
|
| 1352 | + if ( isset( $wp_query->query_vars[$param] ) ) { |
|
| 1353 | + $value = $wp_query->query_vars[$param]; |
|
| 1354 | 1354 | } |
| 1355 | 1355 | |
| 1356 | 1356 | return $value; |
@@ -1384,9 +1384,9 @@ discard block |
||
| 1384 | 1384 | 'frm_keyalt_solid_icon' => 'frm_key_solid_icon', |
| 1385 | 1385 | ); |
| 1386 | 1386 | |
| 1387 | - if ( isset( $deprecated[ $icon ] ) ) { |
|
| 1388 | - $icon = $deprecated[ $icon ]; |
|
| 1389 | - $class = str_replace( $icon, $deprecated[ $icon ], $class ); |
|
| 1387 | + if ( isset( $deprecated[$icon] ) ) { |
|
| 1388 | + $icon = $deprecated[$icon]; |
|
| 1389 | + $class = str_replace( $icon, $deprecated[$icon], $class ); |
|
| 1390 | 1390 | } |
| 1391 | 1391 | |
| 1392 | 1392 | if ( $icon === $class ) { |
@@ -1520,7 +1520,7 @@ discard block |
||
| 1520 | 1520 | * @return string|void |
| 1521 | 1521 | */ |
| 1522 | 1522 | public static function array_to_html_params( $atts, $echo = false ) { |
| 1523 | - $callback = function () use ( $atts ) { |
|
| 1523 | + $callback = function() use ( $atts ) { |
|
| 1524 | 1524 | if ( $atts ) { |
| 1525 | 1525 | foreach ( $atts as $key => $value ) { |
| 1526 | 1526 | echo ' ' . esc_attr( $key ) . '="' . esc_attr( $value ) . '"'; |
@@ -1709,7 +1709,7 @@ discard block |
||
| 1709 | 1709 | 'value' => false, |
| 1710 | 1710 | 'class' => '', |
| 1711 | 1711 | ); |
| 1712 | - $atts = array_merge( $defaults, $atts ); |
|
| 1712 | + $atts = array_merge( $defaults, $atts ); |
|
| 1713 | 1713 | |
| 1714 | 1714 | if ( $atts['input_id'] === 'template' && empty( $atts['tosearch'] ) ) { |
| 1715 | 1715 | $atts['tosearch'] = 'frm-card'; |
@@ -1789,7 +1789,7 @@ discard block |
||
| 1789 | 1789 | 'new_file_path' => self::plugin_path() . '/js', |
| 1790 | 1790 | ) |
| 1791 | 1791 | ); |
| 1792 | - $new_file = new FrmCreateFile( $file_atts ); |
|
| 1792 | + $new_file = new FrmCreateFile( $file_atts ); |
|
| 1793 | 1793 | |
| 1794 | 1794 | $files = array( |
| 1795 | 1795 | self::plugin_path() . '/js/formidable.min.js', |
@@ -2009,8 +2009,8 @@ discard block |
||
| 2009 | 2009 | */ |
| 2010 | 2010 | private static function get_dropdown_value_and_label_from_option( $option, $key, $args ) { |
| 2011 | 2011 | if ( is_array( $option ) ) { |
| 2012 | - $value = $option[ $args['value_key'] ] ?? ''; |
|
| 2013 | - $label = $option[ $args['label_key'] ] ?? ''; |
|
| 2012 | + $value = $option[$args['value_key']] ?? ''; |
|
| 2013 | + $label = $option[$args['label_key']] ?? ''; |
|
| 2014 | 2014 | } else { |
| 2015 | 2015 | $value = $key; |
| 2016 | 2016 | $label = $option; |
@@ -2418,9 +2418,9 @@ discard block |
||
| 2418 | 2418 | return $error; |
| 2419 | 2419 | } |
| 2420 | 2420 | |
| 2421 | - $nonce_value = $_REQUEST && isset( $_REQUEST[ $nonce_name ] ) ? sanitize_text_field( wp_unslash( $_REQUEST[ $nonce_name ] ) ) : ''; |
|
| 2421 | + $nonce_value = $_REQUEST && isset( $_REQUEST[$nonce_name] ) ? sanitize_text_field( wp_unslash( $_REQUEST[$nonce_name] ) ) : ''; |
|
| 2422 | 2422 | |
| 2423 | - if ( $_REQUEST && ( ! isset( $_REQUEST[ $nonce_name ] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
| 2423 | + if ( $_REQUEST && ( ! isset( $_REQUEST[$nonce_name] ) || ! wp_verify_nonce( $nonce_value, $nonce ) ) ) { |
|
| 2424 | 2424 | $frm_settings = self::get_settings(); |
| 2425 | 2425 | $error = $frm_settings->admin_permission; |
| 2426 | 2426 | } |
@@ -2473,7 +2473,7 @@ discard block |
||
| 2473 | 2473 | } else { |
| 2474 | 2474 | foreach ( $value as $k => $v ) { |
| 2475 | 2475 | if ( ! is_array( $v ) ) { |
| 2476 | - $value[ $k ] = call_user_func( $original_function, $v ); |
|
| 2476 | + $value[$k] = call_user_func( $original_function, $v ); |
|
| 2477 | 2477 | } |
| 2478 | 2478 | } |
| 2479 | 2479 | } |
@@ -2527,7 +2527,7 @@ discard block |
||
| 2527 | 2527 | if ( is_array( $value ) ) { |
| 2528 | 2528 | $return = array_merge( $return, self::array_flatten( $value, $keys ) ); |
| 2529 | 2529 | } elseif ( $keys === 'keep' ) { |
| 2530 | - $return[ $key ] = $value; |
|
| 2530 | + $return[$key] = $value; |
|
| 2531 | 2531 | } else { |
| 2532 | 2532 | $return[] = $value; |
| 2533 | 2533 | } |
@@ -2620,11 +2620,11 @@ discard block |
||
| 2620 | 2620 | |
| 2621 | 2621 | $ver = $default; |
| 2622 | 2622 | |
| 2623 | - if ( ! isset( $wp_scripts->registered[ $handle ] ) ) { |
|
| 2623 | + if ( ! isset( $wp_scripts->registered[$handle] ) ) { |
|
| 2624 | 2624 | return $ver; |
| 2625 | 2625 | } |
| 2626 | 2626 | |
| 2627 | - $query = $wp_scripts->registered[ $handle ]; |
|
| 2627 | + $query = $wp_scripts->registered[$handle]; |
|
| 2628 | 2628 | |
| 2629 | 2629 | if ( is_object( $query ) && ! empty( $query->ver ) ) { |
| 2630 | 2630 | $ver = $query->ver; |
@@ -2642,7 +2642,7 @@ discard block |
||
| 2642 | 2642 | * @return string|null |
| 2643 | 2643 | */ |
| 2644 | 2644 | public static function js_redirect( $url, $echo = false ) { |
| 2645 | - $callback = function () use ( $url ) { |
|
| 2645 | + $callback = function() use ( $url ) { |
|
| 2646 | 2646 | echo '<script type="text/javascript">window.location="' . esc_url_raw( $url ) . '"</script>'; |
| 2647 | 2647 | }; |
| 2648 | 2648 | return self::clip( $callback, $echo ); |
@@ -2741,7 +2741,7 @@ discard block |
||
| 2741 | 2741 | $suffix = 2; |
| 2742 | 2742 | do { |
| 2743 | 2743 | $key_check = $key . $separator . $suffix; |
| 2744 | - ++$suffix; |
|
| 2744 | + ++ $suffix; |
|
| 2745 | 2745 | } while ( in_array( $key_check, $similar_keys, true ) ); |
| 2746 | 2746 | |
| 2747 | 2747 | $key = $key_check; |
@@ -2860,7 +2860,7 @@ discard block |
||
| 2860 | 2860 | |
| 2861 | 2861 | foreach ( array( 'name', 'description' ) as $var ) { |
| 2862 | 2862 | $default_val = $record->{$var} ?? ''; |
| 2863 | - $values[ $var ] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
| 2863 | + $values[$var] = self::get_param( $var, $default_val, 'get', 'wp_kses_post' ); |
|
| 2864 | 2864 | unset( $var, $default_val ); |
| 2865 | 2865 | } |
| 2866 | 2866 | |
@@ -2933,10 +2933,10 @@ discard block |
||
| 2933 | 2933 | $meta_value = FrmEntryMeta::get_meta_value( $record, $field->id ); |
| 2934 | 2934 | }//end if |
| 2935 | 2935 | |
| 2936 | - $field_type = $post_values['field_options'][ 'type_' . $field->id ] ?? $field->type; |
|
| 2936 | + $field_type = $post_values['field_options']['type_' . $field->id] ?? $field->type; |
|
| 2937 | 2937 | |
| 2938 | - if ( isset( $post_values['item_meta'][ $field->id ] ) ) { |
|
| 2939 | - $new_value = $post_values['item_meta'][ $field->id ]; |
|
| 2938 | + if ( isset( $post_values['item_meta'][$field->id] ) ) { |
|
| 2939 | + $new_value = $post_values['item_meta'][$field->id]; |
|
| 2940 | 2940 | self::unserialize_or_decode( $new_value ); |
| 2941 | 2941 | } else { |
| 2942 | 2942 | $new_value = $meta_value; |
@@ -2957,7 +2957,7 @@ discard block |
||
| 2957 | 2957 | |
| 2958 | 2958 | $field_array = array_merge( (array) $field->field_options, $field_array ); |
| 2959 | 2959 | |
| 2960 | - $values['fields'][ $field->id ] = $field_array; |
|
| 2960 | + $values['fields'][$field->id] = $field_array; |
|
| 2961 | 2961 | } |
| 2962 | 2962 | |
| 2963 | 2963 | /** |
@@ -3007,11 +3007,11 @@ discard block |
||
| 3007 | 3007 | } |
| 3008 | 3008 | |
| 3009 | 3009 | foreach ( $form->options as $opt => $value ) { |
| 3010 | - if ( isset( $post_values[ $opt ] ) ) { |
|
| 3011 | - $values[ $opt ] = $post_values[ $opt ]; |
|
| 3012 | - self::unserialize_or_decode( $values[ $opt ] ); |
|
| 3010 | + if ( isset( $post_values[$opt] ) ) { |
|
| 3011 | + $values[$opt] = $post_values[$opt]; |
|
| 3012 | + self::unserialize_or_decode( $values[$opt] ); |
|
| 3013 | 3013 | } else { |
| 3014 | - $values[ $opt ] = $value; |
|
| 3014 | + $values[$opt] = $value; |
|
| 3015 | 3015 | } |
| 3016 | 3016 | } |
| 3017 | 3017 | |
@@ -3031,8 +3031,8 @@ discard block |
||
| 3031 | 3031 | |
| 3032 | 3032 | foreach ( $form_defaults as $opt => $default ) { |
| 3033 | 3033 | // phpcs:ignore Universal.Operators.StrictComparisons |
| 3034 | - if ( ! isset( $values[ $opt ] ) || $values[ $opt ] == '' ) { |
|
| 3035 | - $values[ $opt ] = $post_values['options'][ $opt ] ?? $default; |
|
| 3034 | + if ( ! isset( $values[$opt] ) || $values[$opt] == '' ) { |
|
| 3035 | + $values[$opt] = $post_values['options'][$opt] ?? $default; |
|
| 3036 | 3036 | } |
| 3037 | 3037 | |
| 3038 | 3038 | unset( $opt, $default ); |
@@ -3043,8 +3043,8 @@ discard block |
||
| 3043 | 3043 | } |
| 3044 | 3044 | |
| 3045 | 3045 | foreach ( array( 'before', 'after', 'submit' ) as $h ) { |
| 3046 | - if ( ! isset( $values[ $h . '_html' ] ) ) { |
|
| 3047 | - $values[ $h . '_html' ] = $post_values['options'][ $h . '_html' ] ?? FrmFormsHelper::get_default_html( $h ); |
|
| 3046 | + if ( ! isset( $values[$h . '_html'] ) ) { |
|
| 3047 | + $values[$h . '_html'] = $post_values['options'][$h . '_html'] ?? FrmFormsHelper::get_default_html( $h ); |
|
| 3048 | 3048 | } |
| 3049 | 3049 | unset( $h ); |
| 3050 | 3050 | } |
@@ -3261,12 +3261,12 @@ discard block |
||
| 3261 | 3261 | // Show time in specified unit. |
| 3262 | 3262 | $levels = self::get_unit( $levels ); |
| 3263 | 3263 | |
| 3264 | - if ( isset( $time_strings[ $levels ] ) ) { |
|
| 3264 | + if ( isset( $time_strings[$levels] ) ) { |
|
| 3265 | 3265 | $diff = array( |
| 3266 | 3266 | $levels => self::time_format( $levels, $diff ), |
| 3267 | 3267 | ); |
| 3268 | 3268 | $time_strings = array( |
| 3269 | - $levels => $time_strings[ $levels ], |
|
| 3269 | + $levels => $time_strings[$levels], |
|
| 3270 | 3270 | ); |
| 3271 | 3271 | } |
| 3272 | 3272 | |
@@ -3274,13 +3274,13 @@ discard block |
||
| 3274 | 3274 | } |
| 3275 | 3275 | |
| 3276 | 3276 | foreach ( $time_strings as $k => $v ) { |
| 3277 | - if ( ! empty( $diff[ $k ] ) ) { |
|
| 3278 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] ); |
|
| 3279 | - } elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) { |
|
| 3277 | + if ( ! empty( $diff[$k] ) ) { |
|
| 3278 | + $time_strings[$k] = $diff[$k] . ' ' . ( $diff[$k] > 1 ? $v[1] : $v[0] ); |
|
| 3279 | + } elseif ( isset( $diff[$k] ) && count( $time_strings ) === 1 ) { |
|
| 3280 | 3280 | // Account for 0. |
| 3281 | - $time_strings[ $k ] = $diff[ $k ] . ' ' . $v[1]; |
|
| 3281 | + $time_strings[$k] = $diff[$k] . ' ' . $v[1]; |
|
| 3282 | 3282 | } else { |
| 3283 | - unset( $time_strings[ $k ] ); |
|
| 3283 | + unset( $time_strings[$k] ); |
|
| 3284 | 3284 | } |
| 3285 | 3285 | } |
| 3286 | 3286 | |
@@ -3304,8 +3304,8 @@ discard block |
||
| 3304 | 3304 | 'd' => 'days', |
| 3305 | 3305 | ); |
| 3306 | 3306 | |
| 3307 | - if ( isset( $return[ $unit ] ) ) { |
|
| 3308 | - return $diff[ $return[ $unit ] ]; |
|
| 3307 | + if ( isset( $return[$unit] ) ) { |
|
| 3308 | + return $diff[$return[$unit]]; |
|
| 3309 | 3309 | } |
| 3310 | 3310 | |
| 3311 | 3311 | $total = $diff['days'] * self::convert_time( 'd', $unit ); |
@@ -3313,11 +3313,11 @@ discard block |
||
| 3313 | 3313 | $times = array( 'h', 'i', 's' ); |
| 3314 | 3314 | |
| 3315 | 3315 | foreach ( $times as $time ) { |
| 3316 | - if ( ! isset( $diff[ $time ] ) ) { |
|
| 3316 | + if ( ! isset( $diff[$time] ) ) { |
|
| 3317 | 3317 | continue; |
| 3318 | 3318 | } |
| 3319 | 3319 | |
| 3320 | - $total += $diff[ $time ] * self::convert_time( $time, $unit ); |
|
| 3320 | + $total += $diff[$time] * self::convert_time( $time, $unit ); |
|
| 3321 | 3321 | } |
| 3322 | 3322 | |
| 3323 | 3323 | return floor( $total ); |
@@ -3342,7 +3342,7 @@ discard block |
||
| 3342 | 3342 | 'y' => DAY_IN_SECONDS * 365.25, |
| 3343 | 3343 | ); |
| 3344 | 3344 | |
| 3345 | - return $convert[ $from ] / $convert[ $to ]; |
|
| 3345 | + return $convert[$from] / $convert[$to]; |
|
| 3346 | 3346 | } |
| 3347 | 3347 | |
| 3348 | 3348 | /** |
@@ -3355,7 +3355,7 @@ discard block |
||
| 3355 | 3355 | private static function get_unit( $unit ) { |
| 3356 | 3356 | $units = self::get_time_strings(); |
| 3357 | 3357 | |
| 3358 | - if ( isset( $units[ $unit ] ) || is_numeric( $unit ) ) { |
|
| 3358 | + if ( isset( $units[$unit] ) || is_numeric( $unit ) ) { |
|
| 3359 | 3359 | return $unit; |
| 3360 | 3360 | } |
| 3361 | 3361 | |
@@ -3481,17 +3481,17 @@ discard block |
||
| 3481 | 3481 | |
| 3482 | 3482 | case 1: |
| 3483 | 3483 | $l2 = $name; |
| 3484 | - self::add_value_to_array( $name, $l2, $this_val, $vars[ $l1 ] ); |
|
| 3484 | + self::add_value_to_array( $name, $l2, $this_val, $vars[$l1] ); |
|
| 3485 | 3485 | break; |
| 3486 | 3486 | |
| 3487 | 3487 | case 2: |
| 3488 | 3488 | $l3 = $name; |
| 3489 | - self::add_value_to_array( $name, $l3, $this_val, $vars[ $l1 ][ $l2 ] ); |
|
| 3489 | + self::add_value_to_array( $name, $l3, $this_val, $vars[$l1][$l2] ); |
|
| 3490 | 3490 | break; |
| 3491 | 3491 | |
| 3492 | 3492 | case 3: |
| 3493 | 3493 | $l4 = $name; |
| 3494 | - self::add_value_to_array( $name, $l4, $this_val, $vars[ $l1 ][ $l2 ][ $l3 ] ); |
|
| 3494 | + self::add_value_to_array( $name, $l4, $this_val, $vars[$l1][$l2][$l3] ); |
|
| 3495 | 3495 | } |
| 3496 | 3496 | |
| 3497 | 3497 | unset( $this_val, $n ); |
@@ -3515,8 +3515,8 @@ discard block |
||
| 3515 | 3515 | // phpcs:ignore Universal.Operators.StrictComparisons |
| 3516 | 3516 | if ( $name == '' ) { |
| 3517 | 3517 | $vars[] = $val; |
| 3518 | - } elseif ( ! isset( $vars[ $l1 ] ) ) { |
|
| 3519 | - $vars[ $l1 ] = $val; |
|
| 3518 | + } elseif ( ! isset( $vars[$l1] ) ) { |
|
| 3519 | + $vars[$l1] = $val; |
|
| 3520 | 3520 | } |
| 3521 | 3521 | } |
| 3522 | 3522 | |
@@ -3540,7 +3540,7 @@ discard block |
||
| 3540 | 3540 | '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' ), |
| 3541 | 3541 | ); |
| 3542 | 3542 | |
| 3543 | - if ( ! isset( $tooltips[ $name ] ) ) { |
|
| 3543 | + if ( ! isset( $tooltips[$name] ) ) { |
|
| 3544 | 3544 | return; |
| 3545 | 3545 | } |
| 3546 | 3546 | |
@@ -3550,7 +3550,7 @@ discard block |
||
| 3550 | 3550 | echo ' class="frm_help"'; |
| 3551 | 3551 | } |
| 3552 | 3552 | |
| 3553 | - echo ' title="' . esc_attr( $tooltips[ $name ] ); |
|
| 3553 | + echo ' title="' . esc_attr( $tooltips[$name] ); |
|
| 3554 | 3554 | |
| 3555 | 3555 | if ( 'open' !== $class ) { |
| 3556 | 3556 | echo '"'; |
@@ -3622,13 +3622,13 @@ discard block |
||
| 3622 | 3622 | * @return void |
| 3623 | 3623 | */ |
| 3624 | 3624 | private static function prepare_action_slashes( $val, $key, &$post_content ) { |
| 3625 | - if ( ! isset( $post_content[ $key ] ) || is_numeric( $val ) ) { |
|
| 3625 | + if ( ! isset( $post_content[$key] ) || is_numeric( $val ) ) { |
|
| 3626 | 3626 | return; |
| 3627 | 3627 | } |
| 3628 | 3628 | |
| 3629 | 3629 | if ( is_array( $val ) ) { |
| 3630 | 3630 | foreach ( $val as $k1 => $v1 ) { |
| 3631 | - self::prepare_action_slashes( $v1, $k1, $post_content[ $key ] ); |
|
| 3631 | + self::prepare_action_slashes( $v1, $k1, $post_content[$key] ); |
|
| 3632 | 3632 | unset( $k1, $v1 ); |
| 3633 | 3633 | } |
| 3634 | 3634 | } else { |
@@ -3636,7 +3636,7 @@ discard block |
||
| 3636 | 3636 | $val = stripslashes( $val ); |
| 3637 | 3637 | |
| 3638 | 3638 | // Add backslashes before double quotes and forward slashes only |
| 3639 | - $post_content[ $key ] = addcslashes( $val, '"\\/' ); |
|
| 3639 | + $post_content[$key] = addcslashes( $val, '"\\/' ); |
|
| 3640 | 3640 | } |
| 3641 | 3641 | } |
| 3642 | 3642 | |
@@ -3765,14 +3765,14 @@ discard block |
||
| 3765 | 3765 | |
| 3766 | 3766 | $key = $input['name']; |
| 3767 | 3767 | |
| 3768 | - if ( isset( $formatted[ $key ] ) ) { |
|
| 3769 | - if ( is_array( $formatted[ $key ] ) ) { |
|
| 3770 | - $formatted[ $key ][] = $input['value']; |
|
| 3768 | + if ( isset( $formatted[$key] ) ) { |
|
| 3769 | + if ( is_array( $formatted[$key] ) ) { |
|
| 3770 | + $formatted[$key][] = $input['value']; |
|
| 3771 | 3771 | } else { |
| 3772 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
| 3772 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
| 3773 | 3773 | } |
| 3774 | 3774 | } else { |
| 3775 | - $formatted[ $key ] = $input['value']; |
|
| 3775 | + $formatted[$key] = $input['value']; |
|
| 3776 | 3776 | } |
| 3777 | 3777 | } |
| 3778 | 3778 | |
@@ -4503,8 +4503,8 @@ discard block |
||
| 4503 | 4503 | } |
| 4504 | 4504 | |
| 4505 | 4505 | foreach ( $keys as $key ) { |
| 4506 | - if ( isset( $values[ $key ] ) ) { |
|
| 4507 | - $values[ $key ] = self::kses( $values[ $key ], 'all' ); |
|
| 4506 | + if ( isset( $values[$key] ) ) { |
|
| 4507 | + $values[$key] = self::kses( $values[$key], 'all' ); |
|
| 4508 | 4508 | } |
| 4509 | 4509 | } |
| 4510 | 4510 | |
@@ -4571,7 +4571,7 @@ discard block |
||
| 4571 | 4571 | 'role', |
| 4572 | 4572 | 'style', |
| 4573 | 4573 | ); |
| 4574 | - $safe = in_array( $key, $safe_keys, true ); |
|
| 4574 | + $safe = in_array( $key, $safe_keys, true ); |
|
| 4575 | 4575 | }//end if |
| 4576 | 4576 | |
| 4577 | 4577 | /** |
@@ -4724,7 +4724,7 @@ discard block |
||
| 4724 | 4724 | return 0; |
| 4725 | 4725 | } |
| 4726 | 4726 | |
| 4727 | - return strlen( $parts[ count( $parts ) - 1 ] ); |
|
| 4727 | + return strlen( $parts[count( $parts ) - 1] ); |
|
| 4728 | 4728 | } |
| 4729 | 4729 | |
| 4730 | 4730 | /** |
@@ -4744,7 +4744,7 @@ discard block |
||
| 4744 | 4744 | |
| 4745 | 4745 | add_filter( |
| 4746 | 4746 | 'option_gmt_offset', |
| 4747 | - function ( $offset ) { |
|
| 4747 | + function( $offset ) { |
|
| 4748 | 4748 | if ( ! is_string( $offset ) || is_numeric( $offset ) ) { |
| 4749 | 4749 | // Leave a valid value alone. |
| 4750 | 4750 | return $offset; |
@@ -4841,7 +4841,7 @@ discard block |
||
| 4841 | 4841 | return; |
| 4842 | 4842 | } |
| 4843 | 4843 | |
| 4844 | - $ajax_callback = function () use ( $option ) { |
|
| 4844 | + $ajax_callback = function() use ( $option ) { |
|
| 4845 | 4845 | self::dismiss_warning_message( $option ); |
| 4846 | 4846 | }; |
| 4847 | 4847 | |
@@ -4851,7 +4851,7 @@ discard block |
||
| 4851 | 4851 | |
| 4852 | 4852 | add_filter( |
| 4853 | 4853 | 'frm_message_list', |
| 4854 | - function ( $show_messages ) use ( $message, $option ) { |
|
| 4854 | + function( $show_messages ) use ( $message, $option ) { |
|
| 4855 | 4855 | if ( get_option( $option, false ) ) { |
| 4856 | 4856 | return $show_messages; |
| 4857 | 4857 | } |
@@ -153,10 +153,10 @@ discard block |
||
| 153 | 153 | $repeating = ! empty( $args['repeating'] ); |
| 154 | 154 | |
| 155 | 155 | if ( $repeating ) { |
| 156 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 156 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 157 | 157 | $value_is_posted = true; |
| 158 | 158 | } |
| 159 | - } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 159 | + } elseif ( isset( $_POST['item_meta'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 160 | 160 | $value_is_posted = true; |
| 161 | 161 | } |
| 162 | 162 | } |
@@ -200,14 +200,14 @@ discard block |
||
| 200 | 200 | preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER ); |
| 201 | 201 | |
| 202 | 202 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
| 203 | - $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
| 203 | + $add_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
| 204 | 204 | |
| 205 | 205 | $this_atts = ! empty( $add_atts ) ? array_merge( $atts, $add_atts ) : $atts; |
| 206 | 206 | |
| 207 | 207 | $default = FrmEntriesController::show_entry_shortcode( $this_atts ); |
| 208 | 208 | |
| 209 | 209 | // Add the default message. |
| 210 | - $message = str_replace( $shortcodes[0][ $short_key ], $default, $message ); |
|
| 210 | + $message = str_replace( $shortcodes[0][$short_key], $default, $message ); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | return $message; |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | * @return string |
| 222 | 222 | */ |
| 223 | 223 | public static function prepare_display_value( $entry, $field, $atts ) { |
| 224 | - $field_value = $entry->metas[ $field->id ] ?? false; |
|
| 224 | + $field_value = $entry->metas[$field->id] ?? false; |
|
| 225 | 225 | |
| 226 | 226 | if ( FrmAppHelper::pro_is_installed() ) { |
| 227 | 227 | $empty = empty( $field_value ); |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ), '', '', true ); |
| 253 | 253 | } else { |
| 254 | 254 | // Get all values for this field. |
| 255 | - $child_values = $entry->metas[ $atts['embedded_field_id'] ] ?? false; |
|
| 255 | + $child_values = $entry->metas[$atts['embedded_field_id']] ?? false; |
|
| 256 | 256 | |
| 257 | 257 | if ( $child_values ) { |
| 258 | 258 | $child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) ); |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | if ( empty( $args['parent_field_id'] ) ) { |
| 388 | - $_POST['item_meta'][ $field->id ] = $value; |
|
| 388 | + $_POST['item_meta'][$field->id] = $value; |
|
| 389 | 389 | } else { |
| 390 | 390 | self::set_parent_field_posted_value( $field, $value, $args ); |
| 391 | 391 | } |
@@ -403,17 +403,17 @@ discard block |
||
| 403 | 403 | * @return void |
| 404 | 404 | */ |
| 405 | 405 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
| 406 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 407 | - if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 408 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 406 | + if ( isset( $_POST['item_meta'][$args['parent_field_id']] ) && is_array( $_POST['item_meta'][$args['parent_field_id']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 407 | + if ( ! isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) || ! is_array( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 408 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 409 | 409 | } |
| 410 | 410 | } else { |
| 411 | 411 | // All of the section was probably removed. |
| 412 | - $_POST['item_meta'][ $args['parent_field_id'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 413 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 412 | + $_POST['item_meta'][$args['parent_field_id']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 413 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 414 | 414 | } |
| 415 | 415 | |
| 416 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 416 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | /** |
@@ -460,9 +460,9 @@ discard block |
||
| 460 | 460 | private static function get_posted_meta( $field_id, $args ) { |
| 461 | 461 | if ( empty( $args['parent_field_id'] ) ) { |
| 462 | 462 | // Sanitizing is done next. |
| 463 | - $value = isset( $_POST['item_meta'][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 463 | + $value = isset( $_POST['item_meta'][$field_id] ) ? wp_unslash( $_POST['item_meta'][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 464 | 464 | } else { |
| 465 | - $value = isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) ? wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 465 | + $value = isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) ? wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) : ''; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 466 | 466 | } |
| 467 | 467 | return $value; |
| 468 | 468 | } |
@@ -496,14 +496,14 @@ discard block |
||
| 496 | 496 | self::set_other_repeating_vals( $field, $value, $args ); |
| 497 | 497 | |
| 498 | 498 | // Check if there are any posted "Other" values. |
| 499 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 499 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 500 | 500 | |
| 501 | 501 | // Save original value. |
| 502 | 502 | $args['temp_value'] = $value; |
| 503 | 503 | $args['other'] = true; |
| 504 | 504 | |
| 505 | 505 | // Sanitizing is done next. |
| 506 | - $other_vals = wp_unslash( $_POST['item_meta']['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 506 | + $other_vals = wp_unslash( $_POST['item_meta']['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 507 | 507 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
| 508 | 508 | |
| 509 | 509 | // Set the validation value now |
@@ -528,12 +528,12 @@ discard block |
||
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | // Check if there are any other posted "other" values for this field. |
| 531 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 531 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 532 | 532 | // Save original value |
| 533 | 533 | $args['temp_value'] = $value; |
| 534 | 534 | $args['other'] = true; |
| 535 | 535 | |
| 536 | - $other_vals = wp_unslash( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 536 | + $other_vals = wp_unslash( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
| 537 | 537 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $other_vals ); |
| 538 | 538 | |
| 539 | 539 | // Set the validation value now. |
@@ -562,7 +562,7 @@ discard block |
||
| 562 | 562 | if ( is_array( $value ) && $field->type === 'checkbox' ) { |
| 563 | 563 | // Combine "Other" values with checked values. "Other" values will override checked box values. |
| 564 | 564 | foreach ( $other_vals as $k => $v ) { |
| 565 | - if ( isset( $value[ $k ] ) && trim( $v ) === '' ) { |
|
| 565 | + if ( isset( $value[$k] ) && trim( $v ) === '' ) { |
|
| 566 | 566 | // If the other box is checked, but doesn't have a value. |
| 567 | 567 | $value = ''; |
| 568 | 568 | break; |
@@ -580,26 +580,26 @@ discard block |
||
| 580 | 580 | // Multi-select dropdown. |
| 581 | 581 | if ( is_array( $value ) ) { |
| 582 | 582 | // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict |
| 583 | - $o_key = array_search( $field->options[ $other_key ], $value ); |
|
| 583 | + $o_key = array_search( $field->options[$other_key], $value ); |
|
| 584 | 584 | |
| 585 | 585 | if ( $o_key !== false ) { |
| 586 | 586 | // Modify the original value so other key will be preserved. |
| 587 | - $value[ $other_key ] = $value[ $o_key ]; |
|
| 587 | + $value[$other_key] = $value[$o_key]; |
|
| 588 | 588 | |
| 589 | 589 | // By default, the array keys will be numeric for multi-select dropdowns. |
| 590 | 590 | // If going backwards and forwards between pages, the array key will match the other key. |
| 591 | 591 | if ( $o_key !== $other_key ) { |
| 592 | - unset( $value[ $o_key ] ); |
|
| 592 | + unset( $value[$o_key] ); |
|
| 593 | 593 | } |
| 594 | 594 | |
| 595 | 595 | $args['temp_value'] = $value; |
| 596 | - $value[ $other_key ] = reset( $other_vals ); |
|
| 596 | + $value[$other_key] = reset( $other_vals ); |
|
| 597 | 597 | |
| 598 | - if ( FrmAppHelper::is_empty_value( $value[ $other_key ] ) ) { |
|
| 599 | - unset( $value[ $other_key ] ); |
|
| 598 | + if ( FrmAppHelper::is_empty_value( $value[$other_key] ) ) { |
|
| 599 | + unset( $value[$other_key] ); |
|
| 600 | 600 | } |
| 601 | 601 | } |
| 602 | - } elseif ( $field->options[ $other_key ] == $value ) { // phpcs:ignore Universal.Operators.StrictComparisons |
|
| 602 | + } elseif ( $field->options[$other_key] == $value ) { // phpcs:ignore Universal.Operators.StrictComparisons |
|
| 603 | 603 | $value = $other_vals; |
| 604 | 604 | }//end if |
| 605 | 605 | }//end if |
@@ -858,7 +858,7 @@ discard block |
||
| 858 | 858 | * @return void |
| 859 | 859 | */ |
| 860 | 860 | public static function maybe_render_captcha_score( $entry_id ) { |
| 861 | - $query = array( |
|
| 861 | + $query = array( |
|
| 862 | 862 | 'item_id' => (int) $entry_id, |
| 863 | 863 | 'field_id' => 0, |
| 864 | 864 | ); |
@@ -913,7 +913,7 @@ discard block |
||
| 913 | 913 | public static function get_entry_status_label( $status ) { |
| 914 | 914 | $statuses = self::get_entry_statuses(); |
| 915 | 915 | |
| 916 | - return $statuses[ self::get_entry_status( $status ) ]; |
|
| 916 | + return $statuses[self::get_entry_status( $status )]; |
|
| 917 | 917 | } |
| 918 | 918 | |
| 919 | 919 | /** |
@@ -149,14 +149,17 @@ discard block |
||
| 149 | 149 | public static function value_is_posted( $field, $args ) { |
| 150 | 150 | $value_is_posted = false; |
| 151 | 151 | |
| 152 | - if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 152 | + if ( $_POST ) { |
|
| 153 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 153 | 154 | $repeating = ! empty( $args['repeating'] ); |
| 154 | 155 | |
| 155 | 156 | if ( $repeating ) { |
| 156 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 157 | + if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { |
|
| 158 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 157 | 159 | $value_is_posted = true; |
| 158 | 160 | } |
| 159 | - } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 161 | + } elseif ( isset( $_POST['item_meta'][ $field->id ] ) ) { |
|
| 162 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 160 | 163 | $value_is_posted = true; |
| 161 | 164 | } |
| 162 | 165 | } |
@@ -403,8 +406,10 @@ discard block |
||
| 403 | 406 | * @return void |
| 404 | 407 | */ |
| 405 | 408 | private static function set_parent_field_posted_value( $field, $value, $args ) { |
| 406 | - if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 407 | - if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 409 | + if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ] ) && is_array( $_POST['item_meta'][ $args['parent_field_id'] ] ) ) { |
|
| 410 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 411 | + if ( ! isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) || ! is_array( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] ) ) { |
|
| 412 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 408 | 413 | $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ] = array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 409 | 414 | } |
| 410 | 415 | } else { |
@@ -496,7 +501,8 @@ discard block |
||
| 496 | 501 | self::set_other_repeating_vals( $field, $value, $args ); |
| 497 | 502 | |
| 498 | 503 | // Check if there are any posted "Other" values. |
| 499 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 504 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { |
|
| 505 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 500 | 506 | |
| 501 | 507 | // Save original value. |
| 502 | 508 | $args['temp_value'] = $value; |
@@ -528,7 +534,8 @@ discard block |
||
| 528 | 534 | } |
| 529 | 535 | |
| 530 | 536 | // Check if there are any other posted "other" values for this field. |
| 531 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 537 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { |
|
| 538 | +// phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 532 | 539 | // Save original value |
| 533 | 540 | $args['temp_value'] = $value; |
| 534 | 541 | $args['other'] = true; |
@@ -599,7 +606,8 @@ discard block |
||
| 599 | 606 | unset( $value[ $other_key ] ); |
| 600 | 607 | } |
| 601 | 608 | } |
| 602 | - } elseif ( $field->options[ $other_key ] == $value ) { // phpcs:ignore Universal.Operators.StrictComparisons |
|
| 609 | + } elseif ( $field->options[ $other_key ] == $value ) { |
|
| 610 | +// phpcs:ignore Universal.Operators.StrictComparisons |
|
| 603 | 611 | $value = $other_vals; |
| 604 | 612 | }//end if |
| 605 | 613 | }//end if |