WordPress.org

Plugin Directory

Changeset 575508


Ignore:
Timestamp:
07/21/12 16:21:57 (21 months ago)
Author:
dimadin
Message:

Add more isset checks to prevent notices.

Location:
bbpress-digest/trunk/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bbpress-digest/trunk/inc/event.php

    r575479 r575508  
    215215 
    216216                        /* Check if topic list is already created & send it, otherwise create it & send it */ 
    217                         if ( $$topic_list ) { 
     217                        if ( isset( $$topic_list ) && $$topic_list ) { 
    218218                            /* Send notification email */ 
    219219                            wp_mail( $user->user_email, $subject, $message . $$topic_list ); 
  • bbpress-digest/trunk/inc/save-profile.php

    r575479 r575508  
    3030 
    3131    /* Prepare submitted values */ 
    32     $bbp_digest_time = in_array( $_POST['bbp-digest-time'], range( 00, 23 ) ) ? $_POST['bbp-digest-time'] : ''; 
    33     $bbp_digest_day = in_array( $_POST['bbp-digest-day'], range( 0, 6 ) ) ? $_POST['bbp-digest-day'] : ''; 
     32    $bbp_digest_time = ( isset( $_POST['bbp-digest-time'] ) && in_array( $_POST['bbp-digest-time'], range( 00, 23 ) ) ) ? $_POST['bbp-digest-time'] : ''; 
     33    $bbp_digest_day = ( isset( $_POST['bbp-digest-day'] ) && in_array( $_POST['bbp-digest-day'], range( 0, 6 ) ) ) ? $_POST['bbp-digest-day'] : ''; 
    3434    $bbp_digest_forums = ''; 
    3535 
    36     if ( is_array( $_POST['bbp-digest-forums'] ) ) { 
     36    if ( isset( $_POST['bbp-digest-forums'] ) && is_array( $_POST['bbp-digest-forums'] ) ) { 
    3737        $bbp_digest_forums = array(); 
    3838        foreach ( $_POST['bbp-digest-forums'] as $forum_id ) { 
     
    5454 
    5555        /* If a new meta value was added and there was no previous value, add it. */ 
    56         if ( isset( $new_meta_value ) && strlen( $new_meta_value ) > 0 && '' == $meta_value ) 
     56        if ( isset( $new_meta_value ) && ( is_array( $new_meta_value ) || strlen( $new_meta_value ) > 0 ) && '' == $meta_value ) 
    5757            add_user_meta( $user_id, $meta_key, $new_meta_value, true ); 
    5858 
    5959        /* If the new meta value does not match the old value, update it. */ 
    60         elseif ( isset( $new_meta_value ) && strlen( $new_meta_value ) > 0 && $new_meta_value != $meta_value ) 
     60        elseif ( isset( $new_meta_value ) && ( is_array( $new_meta_value ) || strlen( $new_meta_value ) > 0 ) && $new_meta_value != $meta_value ) 
    6161            update_user_meta( $user_id, $meta_key, $new_meta_value ); 
    6262 
Note: See TracChangeset for help on using the changeset viewer.