From 13d5ff7090e00536c67f07348f98f0e2de2f5fd2 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 12 Sep 2013 07:17:11 +0000 Subject: [PATCH] * Fill in undefined var in `Tests_Option_BlogOption` * Add `defined()` check for `BLOGSUPLOADDIR` * Suppress deprecated function notices for `is_blog_user()` and `get_dashboard_blog()` * Check existence of `$user` in `wpmu_log_new_registrations()` before arbitrarily making a database query Fixes all notices in multisite unit tests. See #25282. Built from https://develop.svn.wordpress.org/trunk@25397 git-svn-id: http://core.svn.wordpress.org/trunk@25328 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-functions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index eb44be0290..830bb5cc28 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -1476,7 +1476,8 @@ function update_posts_count( $deprecated = '' ) { function wpmu_log_new_registrations( $blog_id, $user_id ) { global $wpdb; $user = get_userdata( (int) $user_id ); - $wpdb->insert( $wpdb->registration_log, array('email' => $user->user_email, 'IP' => preg_replace( '/[^0-9., ]/', '', wp_unslash( $_SERVER['REMOTE_ADDR'] ) ), 'blog_id' => $blog_id, 'date_registered' => current_time('mysql')) ); + if ( $user ) + $wpdb->insert( $wpdb->registration_log, array('email' => $user->user_email, 'IP' => preg_replace( '/[^0-9., ]/', '', wp_unslash( $_SERVER['REMOTE_ADDR'] ) ), 'blog_id' => $blog_id, 'date_registered' => current_time('mysql')) ); } /**