Coding Standards: Use strict comparison in `wpmu_validate_blog_signup()`.
Follow-up to [https://mu.trac.wordpress.org/changeset/8 mu:8], [https://mu.trac.wordpress.org/changeset/543 mu:543], [https://mu.trac.wordpress.org/changeset/550 mu:550], [https://mu.trac.wordpress.org/changeset/1364 mu:1364], [https://mu.trac.wordpress.org/changeset/1958 mu:1958], [12603], [32733]. Props debarghyabanerjee, aristath, poena, afercia, SergeyBiryukov. See #62279, #62283. Built from https://develop.svn.wordpress.org/trunk@59573 git-svn-id: http://core.svn.wordpress.org/trunk@58959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1ea8475be2
commit
43380703cb
|
@ -481,10 +481,12 @@ function wpmu_validate_user_signup( $user_name, $user_email ) {
|
|||
}
|
||||
|
||||
$illegal_names = get_site_option( 'illegal_names' );
|
||||
|
||||
if ( ! is_array( $illegal_names ) ) {
|
||||
$illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
|
||||
add_site_option( 'illegal_names', $illegal_names );
|
||||
}
|
||||
|
||||
if ( in_array( $user_name, $illegal_names, true ) ) {
|
||||
$errors->add( 'user_name', __( 'Sorry, that username is not allowed.' ) );
|
||||
}
|
||||
|
@ -516,10 +518,12 @@ function wpmu_validate_user_signup( $user_name, $user_email ) {
|
|||
}
|
||||
|
||||
$limited_email_domains = get_site_option( 'limited_email_domains' );
|
||||
|
||||
if ( is_array( $limited_email_domains ) && ! empty( $limited_email_domains ) ) {
|
||||
$limited_email_domains = array_map( 'strtolower', $limited_email_domains );
|
||||
$emaildomain = strtolower( substr( $user_email, 1 + strpos( $user_email, '@' ) ) );
|
||||
if ( ! in_array( $emaildomain, $limited_email_domains, true ) ) {
|
||||
$email_domain = strtolower( substr( $user_email, 1 + strpos( $user_email, '@' ) ) );
|
||||
|
||||
if ( ! in_array( $email_domain, $limited_email_domains, true ) ) {
|
||||
$errors->add( 'user_email', __( 'Sorry, that email address is not allowed!' ) );
|
||||
}
|
||||
}
|
||||
|
@ -637,7 +641,8 @@ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) {
|
|||
|
||||
$errors = new WP_Error();
|
||||
$illegal_names = get_site_option( 'illegal_names' );
|
||||
if ( false == $illegal_names ) {
|
||||
|
||||
if ( ! is_array( $illegal_names ) ) {
|
||||
$illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
|
||||
add_site_option( 'illegal_names', $illegal_names );
|
||||
}
|
||||
|
@ -721,7 +726,7 @@ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) {
|
|||
* unless it's the user's own username.
|
||||
*/
|
||||
if ( username_exists( $blogname ) ) {
|
||||
if ( ! is_object( $user ) || ( is_object( $user ) && ( $user->user_login != $blogname ) ) ) {
|
||||
if ( ! is_object( $user ) || ( is_object( $user ) && ( $user->user_login !== $blogname ) ) ) {
|
||||
$errors->add( 'blogname', __( 'Sorry, that site is reserved!' ) );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.8-alpha-59572';
|
||||
$wp_version = '6.8-alpha-59573';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue