WordPress.org

Make WordPress Core

Changeset 24509


Ignore:
Timestamp:
06/25/2013 02:24:18 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Avoid a fatal error when adding a non-existent user to a site. props duck_. fixes #24460.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/network/site-users.php

    r23974 r24509  
    8787                $newuser = $_POST['newuser'];
    8888                $user = get_user_by( 'login', $newuser );
    89                 if ( $user->exists() ) {
     89                if ( $user && $user->exists() ) {
    9090                    if ( ! is_user_member_of_blog( $user->ID, $id ) )
    9191                        add_user_to_blog( $id, $user->ID, $_POST['new_role'] );
Note: See TracChangeset for help on using the changeset viewer.