Skip to content

Commit 7e675a0

Browse files
committed
Resolve array key issues
1 parent 44358b8 commit 7e675a0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mailchimp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ function mailchimp_sf_merge_submit( $mv ) {
989989
$opt_val = isset( $_POST[ $opt ] ) ? map_deep( stripslashes_deep( $_POST[ $opt ] ), 'sanitize_text_field' ) : '';
990990

991991
// Handle phone number logic
992-
if ( 'phone' === $mv_var['type'] && 'US' === $mv_var['options']['phone_format'] ) {
992+
if ( isset( $mv_var['options']['phone_format'] ) && 'phone' === $mv_var['type'] && 'US' === $mv_var['options']['phone_format'] ) {
993993
$opt_val = mailchimp_sf_merge_validate_phone( $opt_val, $mv_var );
994994
if ( is_wp_error( $opt_val ) ) {
995995
return $opt_val;

views/setup_page.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676

7777
<br/>
7878
<?php
79-
if ( '' !== $user && $user['username'] ) {
79+
if ( '' !== $user && isset( $user['username'] ) && $user['username'] ) {
8080
?>
8181
<!--<div class="notes_msg">
8282
<strong><?php esc_html_e( 'Notes', 'mailchimp_i18n' ); ?>:</strong>
@@ -233,7 +233,7 @@
233233
<tr><th colspan="2">Remove Mailchimp CSS</th></tr>
234234
<tr class="mc-internal-heading"><th><label for="mc_nuke_all_styles"><?php esc_html_e( 'Remove CSS' ); ?></label></th><td><span class="mc-pre-input"></span><input type="checkbox" name="mc_nuke_all_styles" id="mc_nuke_all_styles" <?php checked( get_option( 'mc_nuke_all_styles' ), true ); ?> onclick="showMe('mc-custom-styling')"/><?php esc_html_e( 'This will disable all Mailchimp CSS, so it\'s recommended for WordPress experts only.' ); ?></td></tr>
235235
</table>
236-
<?php if ( get_option( 'mc_nuke_all_styles' ) === true ) { ?>
236+
<?php if ( get_option( 'mc_nuke_all_styles' ) === '1' ) { ?>
237237
<table class="widefat mc-widefat mc-custom-styling" id="mc-custom-styling" style="display:none">
238238
<?php } else { ?>
239239
<table class="widefat mc-widefat mc-custom-styling" id="mc-custom-styling">
@@ -331,7 +331,7 @@
331331
<?php
332332
$mv = get_option( 'mc_merge_vars' );
333333

334-
if ( count( $mv ) === 0 || ! is_array( $mv ) ) {
334+
if ( ! is_array( $mv ) || count( $mv ) === 0 ) {
335335
?>
336336
<em><?php esc_html_e( 'No Merge Fields found.', 'mailchimp_i18n' ); ?></em>
337337
<?php

0 commit comments

Comments
 (0)