Make WordPress Core

Ticket #19724: wp-3.3-idn-signup.diff

File wp-3.3-idn-signup.diff, 4.0 KB (added by qdinar, 10 years ago)
  • wp-admin/network/settings.php

    diff -ru wordpress-3.3/wp-admin/network/settings.php /var/www/saytlar/blogo/wp-admin/network/settings.php
    old new  
    6565                $limited_email = array();
    6666                foreach ( (array) $limited_email_domains as $domain ) {
    6767                        $domain = trim( $domain );
    68                         if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
     68                        if ( ! preg_match( '/(\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
    6969                                $limited_email[] = trim( $domain );
    7070                }
    7171                update_site_option( 'limited_email_domains', $limited_email );
     
    7878                $banned = array();
    7979                foreach ( (array) $banned_email_domains as $domain ) {
    8080                        $domain = trim( $domain );
    81                         if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
     81                        if ( ! preg_match( '/(\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
    8282                                $banned[] = trim( $domain );
    8383                }
    8484                update_site_option( 'banned_email_domains', $banned );
  • wp-admin/network/site-new.php

    diff -ru wordpress-3.3/wp-admin/network/site-new.php /var/www/saytlar/blogo/wp-admin/network/site-new.php
    old new  
    127127                        <?php } else {
    128128                                echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" type="text" title="<?php esc_attr_e( 'Domain' ) ?>"/>
    129129                        <?php }
    130                         echo '<p>' . __( 'Only the characters a-z and 0-9 recommended.' ) . '</p>';
     130                        echo '<p>' . __( 'Only letters, digits and dashes are recommended.' ) . '</p>';
    131131                        ?>
    132132                        </td>
    133133                </tr>
  • wp-includes/ms-functions.php

    diff -ru wordpress-3.3/wp-includes/ms-functions.php /var/www/saytlar/blogo/wp-includes/ms-functions.php
    old new  
    563563        if ( empty( $blogname ) )
    564564                $errors->add('blogname', __('Please enter a site name'));
    565565
    566         if ( preg_match( '/[^a-z0-9]+/', $blogname ) )
     566        if ( preg_match( '/[^a-z0-9-]+/', $blogname ) )
    567567                $errors->add('blogname', __('Only lowercase letters and numbers allowed'));
    568568
    569569        if ( in_array( $blogname, $illegal_names ) == true )
  • wp-signup.php

    diff -ru wordpress-3.3/wp-signup.php /var/www/saytlar/blogo/wp-signup.php
    old new  
    7373        if ( !is_subdomain_install() )
    7474                echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span><input name="blogname" type="text" id="blogname" value="'. esc_attr($blogname) .'" maxlength="60" /><br />';
    7575        else
    76                 echo '<input name="blogname" type="text" id="blogname" value="'.esc_attr($blogname).'" maxlength="60" /><span class="suffix_address">.' . ( $site_domain = preg_replace( '|^www\.|', '', $current_site->domain ) ) . '</span><br />';
     76                echo '<input name="blogname" type="text" id="blogname" value="'.idn_to_unicode(esc_attr($blogname)).'" maxlength="60" /><span class="suffix_address">.' . ( $site_domain = idn_to_unicode( preg_replace( '|^www\.|', '', $current_site->domain ) ) ) . '</span><br />';
    7777
    7878        if ( !is_user_logged_in() ) {
    7979                if ( !is_subdomain_install() )
     
    127127                echo '<p class="error">'.$errmsg.'</p>';
    128128        }
    129129        echo '<input name="user_name" type="text" id="user_name" value="'. esc_attr($user_name) .'" maxlength="60" /><br />';
    130         _e( '(Must be at least 4 characters, letters and numbers only.)' );
     130        _e( '(Must be at least 4 characters, latin letters and numbers only.)' );
    131131        ?>
    132132
    133133        <label for="user_email"><?php _e( 'Email&nbsp;Address:' ) ?></label>
     
    374374}
    375375
    376376// Main
     377$_POST['blogname']=idn_to_ascii($_POST['blogname']);
    377378$active_signup = get_site_option( 'registration' );
    378379if ( !$active_signup )
    379380        $active_signup = 'all';