diff --git bp-core/deprecated/1.9.php bp-core/deprecated/1.9.php
new file mode 100644
index 0000000..ffe869f
|
-
|
+
|
|
| | 1 | <?php |
| | 2 | /** |
| | 3 | * Deprecated Functions |
| | 4 | * |
| | 5 | * @package BuddyPress |
| | 6 | * @subpackage Core |
| | 7 | * @deprecated Since 1.9 |
| | 8 | */ |
| | 9 | |
| | 10 | /** |
| | 11 | * Strips spaces from usernames that are created using add_user() and wp_insert_user() |
| | 12 | * |
| | 13 | * @package BuddyPress Core |
| | 14 | * @deprecated BuddyPress (1.9) |
| | 15 | */ |
| | 16 | function bp_core_strip_username_spaces( $username ) { |
| | 17 | _deprecated_function( __FUNCTION__, '1.9' ); |
| | 18 | |
| | 19 | // Don't alter the user_login of existing users, as it causes user_nicename problems. |
| | 20 | // See http://trac.buddypress.org/ticket/2642 |
| | 21 | if ( username_exists( $username ) && ( !bp_is_username_compatibility_mode() ) ) |
| | 22 | return $username; |
| | 23 | |
| | 24 | return str_replace( ' ', '-', $username ); |
| | 25 | } |
| | 26 | |
diff --git bp-members/bp-members-functions.php bp-members/bp-members-functions.php
index 9289d1a..49a35dd 100644
|
|
|
function bp_core_ucfirst( $str ) { |
| 945 | 945 | } |
| 946 | 946 | |
| 947 | 947 | /** |
| 948 | | * Strips spaces from usernames that are created using add_user() and wp_insert_user() |
| 949 | | * |
| 950 | | * @package BuddyPress Core |
| 951 | | */ |
| 952 | | function bp_core_strip_username_spaces( $username ) { |
| 953 | | // Don't alter the user_login of existing users, as it causes user_nicename problems. |
| 954 | | // See http://trac.buddypress.org/ticket/2642 |
| 955 | | if ( username_exists( $username ) && ( !bp_is_username_compatibility_mode() ) ) |
| 956 | | return $username; |
| 957 | | |
| 958 | | return str_replace( ' ', '-', $username ); |
| 959 | | } |
| 960 | | add_action( 'pre_user_login', 'bp_core_strip_username_spaces' ); |
| 961 | | |
| 962 | | /** |
| 963 | 948 | * When a user logs in, check if they have been marked as a spammer. If yes then simply |
| 964 | 949 | * redirect them to the home page and stop them from logging in. |
| 965 | 950 | * |
| … |
… |
function bp_core_validate_user_signup( $user_name, $user_email ) { |
| 1211 | 1196 | if ( strpos( ' ' . $user_name, '_' ) != false ) |
| 1212 | 1197 | $errors->add( 'user_name', __( 'Sorry, usernames may not contain the character "_"!', 'buddypress' ) ); |
| 1213 | 1198 | |
| | 1199 | if ( false !== strpos( $user_name, ' ' ) ) { |
| | 1200 | $errors->add( 'user_name', __( 'Sorry, usernames may not contain spaces.', 'buddypress' ) ); |
| | 1201 | } |
| | 1202 | |
| 1214 | 1203 | // Is the user_name all numeric? |
| 1215 | 1204 | $match = array(); |
| 1216 | 1205 | preg_match( '/[0-9]*/', $user_name, $match ); |