Making WordPress.org


Ignore:
Timestamp:
11/10/2022 11:34:38 PM (4 years ago)
Author:
coffee2code
Message:

Photo Directory, User: Bail earlier when no user is known.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/user.php

    r12233 r12236  
    4545                        global $authordata;
    4646
    47                         $user_id = $authordata->ID;
     47                        $user_id = $authordata->ID ?? 0;
     48                }
     49
     50                if ( ! $user_id ) {
     51                        return 0;
    4852                }
    4953
    … …  
    7579                        global $authordata;
    7680
    77                         $user_id = $authordata->ID;
     81                        $user_id = $authordata->ID ?? 0;
     82                }
     83
     84                if ( ! $user_id ) {
     85                        return [];
    7886                }
    7987
Note: See TracChangeset for help on using the changeset viewer.