WordPress.org

Make WordPress Core

Ticket #20116: 20116.3.patch

File 20116.3.patch, 2.7 KB (added by SergeyBiryukov, 6 years ago)
  • wp-admin/includes/schema.php

     
    894894                'illegal_names' => array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator', 'files' ),
    895895                'wpmu_upgrade_site' => $wp_db_version,
    896896                'welcome_email' => $welcome_email,
     897                'welcome_user_email' => welcome_user_msg_filter(),
    897898                'first_post' => __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start blogging!' ),
    898899                // @todo - network admins should have a method of editing the network siteurl (used for cookie hash)
    899900                'siteurl' => get_option( 'siteurl' ) . '/',
  • wp-admin/includes/upgrade.php

     
    13061306                        update_site_option( 'allowedthemes', $converted );
    13071307                        delete_site_option( 'allowed_themes' );
    13081308                }
     1309
     1310                if ( false === get_site_option( 'welcome_user_email' ) )
     1311                        update_site_option( 'welcome_user_email', welcome_user_msg_filter() );
    13091312        }
    13101313}
    13111314
  • wp-includes/ms-functions.php

     
    12161216                return false;
    12171217
    12181218        $welcome_email = stripslashes( get_site_option( 'welcome_email' ) );
    1219         if ( $welcome_email == false )
     1219        if ( false == $welcome_email )
    12201220                $welcome_email = stripslashes( __( 'Dear User,
    12211221
    12221222Your new SITE_NAME site has been successfully set up at:
     
    12791279        if ( !apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta) )
    12801280                return false;
    12811281
    1282         $welcome_email = get_site_option( 'welcome_user_email' );
     1282        $welcome_email = stripslashes( get_site_option( 'welcome_user_email' ) );
     1283        if ( false == $welcome_email )
     1284                $welcome_email = welcome_user_msg_filter();
    12831285
    12841286        $user = new WP_User($user_id);
    12851287
     
    18851887add_filter('option_users_can_register', 'users_can_register_signup_filter');
    18861888
    18871889/**
    1888  * Ensure that the welcome message is not empty. Currently unused.
     1890 * Ensure that the welcome message is not empty.
    18891891 *
    18901892 * @since MU
    18911893 *
    18921894 * @param string $text
    18931895 * @return string
    18941896 */
    1895 function welcome_user_msg_filter( $text ) {
     1897function welcome_user_msg_filter( $text = false ) {
    18961898        if ( !$text ) {
    18971899                return __( 'Dear User,
    18981900
     
    19091911        }
    19101912        return $text;
    19111913}
    1912 add_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' );
    19131914
    19141915/**
    19151916 * Whether to force SSL on content.