WordPress.org

Make WordPress Core

Ticket #39676: 39676.2.diff

File 39676.2.diff, 1.3 KB (added by flixos90, 2 years ago)
  • src/wp-includes/ms-default-filters.php

     
    3333add_filter( 'sanitize_user', 'strtolower' );
    3434
    3535// Blogs
     36add_filter( 'wpmu_validate_blog_signup', 'signup_check_minimum_length' );
    3637add_filter( 'wpmu_validate_blog_signup', 'signup_nonce_check' );
    3738add_action( 'wpmu_new_blog', 'wpmu_log_new_registrations', 10, 2 );
    3839add_action( 'wpmu_new_blog', 'newblog_notify_siteadmin', 10, 2 );
  • src/wp-includes/ms-functions.php

     
    19991999}
    20002000
    20012001/**
     2002 * Checks a signup blogname for its length.
     2003 *
     2004 * @since 4.8.0
     2005 *
     2006 * @param array $result Array of domain, path, blog name, blog title, user and error messages.
     2007 * @return array Possibly modified array with an additional error.
     2008 */
     2009function signup_check_minimum_length( $result ) {
     2010        if ( strlen( $result['blogname'] ) < 4 ) {
     2011                $result['errors']->add( 'blogname', __( 'Site name must be at least 4 characters.' ) );
     2012        }
     2013
     2014        return $result;
     2015}
     2016
     2017/**
    20022018 * Correct 404 redirects when NOBLOGREDIRECT is defined.
    20032019 *
    20042020 * @since MU