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

File wp-3.3-idn-signup.diff, 4.0 KB (added by qdinar, 17 months ago)
Line 
1diff -ru wordpress-3.3/wp-admin/network/settings.php /var/www/saytlar/blogo/wp-admin/network/settings.php
2--- wordpress-3.3/wp-admin/network/settings.php 2011-12-13 06:00:41.000000000 +0000
3+++ /var/www/saytlar/blogo/wp-admin/network/settings.php        2012-01-03 22:37:11.000000000 +0000
4@@ -65,7 +65,7 @@
5                $limited_email = array();
6                foreach ( (array) $limited_email_domains as $domain ) {
7                        $domain = trim( $domain );
8-                       if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
9+                       if ( ! preg_match( '/(\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
10                                $limited_email[] = trim( $domain );
11                }
12                update_site_option( 'limited_email_domains', $limited_email );
13@@ -78,7 +78,7 @@
14                $banned = array();
15                foreach ( (array) $banned_email_domains as $domain ) {
16                        $domain = trim( $domain );
17-                       if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
18+                       if ( ! preg_match( '/(\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
19                                $banned[] = trim( $domain );
20                }
21                update_site_option( 'banned_email_domains', $banned );
22diff -ru wordpress-3.3/wp-admin/network/site-new.php /var/www/saytlar/blogo/wp-admin/network/site-new.php
23--- wordpress-3.3/wp-admin/network/site-new.php 2011-12-13 06:00:41.000000000 +0000
24+++ /var/www/saytlar/blogo/wp-admin/network/site-new.php        2012-01-03 23:47:22.000000000 +0000
25@@ -127,7 +127,7 @@
26                        <?php } else {
27                                echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" type="text" title="<?php esc_attr_e( 'Domain' ) ?>"/>
28                        <?php }
29-                       echo '<p>' . __( 'Only the characters a-z and 0-9 recommended.' ) . '</p>';
30+                       echo '<p>' . __( 'Only letters, digits and dashes are recommended.' ) . '</p>';
31                        ?>
32                        </td>
33                </tr>
34diff -ru wordpress-3.3/wp-includes/ms-functions.php /var/www/saytlar/blogo/wp-includes/ms-functions.php
35--- wordpress-3.3/wp-includes/ms-functions.php  2011-12-13 06:00:40.000000000 +0000
36+++ /var/www/saytlar/blogo/wp-includes/ms-functions.php 2012-01-03 22:19:37.000000000 +0000
37@@ -563,7 +563,7 @@
38        if ( empty( $blogname ) )
39                $errors->add('blogname', __('Please enter a site name'));
40 
41-       if ( preg_match( '/[^a-z0-9]+/', $blogname ) )
42+       if ( preg_match( '/[^a-z0-9-]+/', $blogname ) )
43                $errors->add('blogname', __('Only lowercase letters and numbers allowed'));
44 
45        if ( in_array( $blogname, $illegal_names ) == true )
46diff -ru wordpress-3.3/wp-signup.php /var/www/saytlar/blogo/wp-signup.php
47--- wordpress-3.3/wp-signup.php 2011-12-13 06:00:41.000000000 +0000
48+++ /var/www/saytlar/blogo/wp-signup.php        2012-01-04 01:06:13.000000000 +0000
49@@ -73,7 +73,7 @@
50        if ( !is_subdomain_install() )
51                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 />';
52        else
53-               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 />';
54+               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 />';
55 
56        if ( !is_user_logged_in() ) {
57                if ( !is_subdomain_install() )
58@@ -127,7 +127,7 @@
59                echo '<p class="error">'.$errmsg.'</p>';
60        }
61        echo '<input name="user_name" type="text" id="user_name" value="'. esc_attr($user_name) .'" maxlength="60" /><br />';
62-       _e( '(Must be at least 4 characters, letters and numbers only.)' );
63+       _e( '(Must be at least 4 characters, latin letters and numbers only.)' );
64        ?>
65 
66        <label for="user_email"><?php _e( 'Email&nbsp;Address:' ) ?></label>
67@@ -374,6 +374,7 @@
68 }
69 
70 // Main
71+$_POST['blogname']=idn_to_ascii($_POST['blogname']);
72 $active_signup = get_site_option( 'registration' );
73 if ( !$active_signup )
74        $active_signup = 'all';