Plugin Directory

Changeset 1005828


Ignore:
Timestamp:
10/11/2014 09:26:41 PM (11 years ago)
Author:
pathawks
Message:

Check if $id_or_email is_object before looking at properties

File:
1 edited

Legend:

Unmodified
Added
Removed
  • better-avatars/trunk/better-avatars.php

    r961345 r1005828  
    8787    if ( is_email( $id_or_email ) ) {
    8888        $email = $id_or_email;
    89     } elseif ( strlen( $id_or_email->comment_author_email ) ) {
     89    } elseif ( is_object($id_or_email) && strlen( $id_or_email->comment_author_email ) ) {
    9090        $email = $id_or_email->comment_author_email;
    9191    } elseif ( is_numeric($id_or_email) ) {
    9292        $id = (int) $id_or_email;
    9393        $email = get_user_meta( $id, 'user_email', TRUE);
    94     } elseif ( !empty( $id_or_email->user_id ) ) {
     94    } elseif ( is_object($id_or_email) && !empty( $id_or_email->user_id ) ) {
    9595        $email = get_user_meta( $id_or_email->user_id, 'user_email', TRUE);
    9696    }
Note: See TracChangeset for help on using the changeset viewer.