@@ -79,8 +79,9 @@ |
||
| 79 | 79 | * Check permissions. |
| 80 | 80 | */ |
| 81 | 81 | while ( $error = $view->can_render( array( 'shortcode' ), $request ) ) { |
| 82 | - if ( ! is_wp_error( $error ) ) |
|
| 83 | - break; |
|
| 82 | + if ( ! is_wp_error( $error ) ) { |
|
| 83 | + break; |
|
| 84 | + } |
|
| 84 | 85 | |
| 85 | 86 | switch ( str_replace( 'gravityview/', '', $error->get_error_code() ) ) { |
| 86 | 87 | case 'post_password_required': |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | $slug = apply_filters( 'gravityview_slug', 'view' ); |
| 210 | 210 | $rule = array( sprintf( '%s/([^/]+)/csv/?', $slug ), 'index.php?gravityview=$matches[1]&csv=1', 'top' ); |
| 211 | 211 | |
| 212 | - add_filter( 'query_vars', function( $query_vars ) { |
|
| 212 | + add_filter( 'query_vars', function( $query_vars ) { |
|
| 213 | 213 | $query_vars[] = 'csv'; |
| 214 | 214 | return $query_vars; |
| 215 | 215 | } ); |
@@ -254,8 +254,9 @@ discard block |
||
| 254 | 254 | * Check permissions. |
| 255 | 255 | */ |
| 256 | 256 | while ( $error = $view->can_render( null, $request ) ) { |
| 257 | - if ( ! is_wp_error( $error ) ) |
|
| 258 | - break; |
|
| 257 | + if ( ! is_wp_error( $error ) ) { |
|
| 258 | + break; |
|
| 259 | + } |
|
| 259 | 260 | |
| 260 | 261 | switch ( str_replace( 'gravityview/', '', $error->get_error_code() ) ) { |
| 261 | 262 | case 'post_password_required': |
@@ -958,7 +958,7 @@ discard block |
||
| 958 | 958 | |
| 959 | 959 | $back_link = esc_url( remove_query_arg( array( 'page', 'view', 'edit' ) ) ); |
| 960 | 960 | |
| 961 | - if( ! $this->is_valid ){ |
|
| 961 | + if( ! $this->is_valid ) { |
|
| 962 | 962 | |
| 963 | 963 | // Keeping this compatible with Gravity Forms. |
| 964 | 964 | $validation_message = "<div class='validation_error'>" . __('There was a problem with your submission.', 'gravityview') . " " . __('Errors have been highlighted below.', 'gravityview') . "</div>"; |
@@ -1755,9 +1755,11 @@ discard block |
||
| 1755 | 1755 | */ |
| 1756 | 1756 | function unselect_default_values( $form ) { |
| 1757 | 1757 | foreach ( $form['fields'] as &$field ) { |
| 1758 | - if ( $field->choices ) foreach ( $field->choices as &$choice ) { |
|
| 1758 | + if ( $field->choices ) { |
|
| 1759 | + foreach ( $field->choices as &$choice ) { |
|
| 1759 | 1760 | if ( \GV\Utils::get( $choice, 'isSelected' ) ) { |
| 1760 | 1761 | $choice['isSelected'] = false; |
| 1762 | + } |
|
| 1761 | 1763 | } |
| 1762 | 1764 | } |
| 1763 | 1765 | } |
@@ -2032,9 +2034,7 @@ discard block |
||
| 2032 | 2034 | // Verify |
| 2033 | 2035 | else if( ! $this->is_edit_entry() ) { |
| 2034 | 2036 | $valid = false; |
| 2035 | - } |
|
| 2036 | - |
|
| 2037 | - else { |
|
| 2037 | + } else { |
|
| 2038 | 2038 | $valid = wp_verify_nonce( $_GET['edit'], self::$nonce_key ); |
| 2039 | 2039 | } |
| 2040 | 2040 | |