Changeset 13984 for trunk/src/bp-members/bp-members-functions.php
- Timestamp:
- 07/27/2024 07:01:02 PM (20 months ago)
- File:
-
- 1 edited
-
trunk/src/bp-members/bp-members-functions.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-functions.php
r13983 r13984 1622 1622 // Note: This check only works on Multisite. 1623 1623 $limited_email_domains = get_site_option( 'limited_email_domains' ); 1624 if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false) {1624 if ( is_array( $limited_email_domains ) && ! empty( $limited_email_domains ) ) { 1625 1625 $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) ); 1626 if ( ! in_array( $emaildomain, $limited_email_domains ) ) { 1626 1627 if ( ! in_array( $emaildomain, $limited_email_domains, true ) ) { 1627 1628 $errors['domain_not_allowed'] = 1; 1628 1629 } … … 1634 1635 } 1635 1636 1636 $retval = ! empty( $errors ) ? $errors : true; 1637 1638 return $retval; 1637 return ! empty( $errors ) ? $errors : true; 1639 1638 } 1640 1639 … … 1713 1712 // User name can't be on the list of illegal names. 1714 1713 $illegal_names = get_site_option( 'illegal_names' ); 1715 if ( in_array( $user_name, (array) $illegal_names ) ) {1716 $errors->add( 'user_name', __( 'That username is not allowed ', 'buddypress' ) );1714 if ( in_array( $user_name, (array) $illegal_names, true ) ) { 1715 $errors->add( 'user_name', __( 'That username is not allowed.', 'buddypress' ) ); 1717 1716 } 1718 1717 … … 1724 1723 // Minimum of 4 characters. 1725 1724 if ( strlen( $user_name ) < 4 ) { 1726 $errors->add( 'user_name', __( 'Username must be at least 4 characters', 'buddypress' ) ); 1725 $errors->add( 'user_name', __( 'Username must be at least 4 characters.', 'buddypress' ) ); 1726 } 1727 1728 // Maximum of 60 characters. 1729 if ( strlen( $user_name ) > 60 ) { 1730 $errors->add( 'user_name', __( 'Username may not be longer than 60 characters.', 'buddypress' ) ); 1727 1731 } 1728 1732 1729 1733 // No underscores. @todo Why not? 1730 if ( false !== strpos( ' ' . $user_name, '_' ) ) {1734 if ( str_contains( ' ' . $user_name, '_' ) ) { 1731 1735 $errors->add( 'user_name', __( 'Sorry, usernames may not contain the character "_"!', 'buddypress' ) ); 1732 1736 } … … 1735 1739 $match = array(); 1736 1740 preg_match( '/[0-9]*/', $user_name, $match ); 1737 if ( $match[0] == $user_name ) { 1741 1742 // Check for valid letters. 1743 $valid_letters = preg_match( '/[a-zA-Z]+/', $user_name ); 1744 1745 if ( $match[0] === $user_name || ! $valid_letters ) { 1738 1746 $errors->add( 'user_name', __( 'Sorry, usernames must have letters too!', 'buddypress' ) ); 1739 1747 } 1740 1748 1741 1749 // Check into signups. 1742 $signups = BP_Signup::get( array( 1743 'user_login' => $user_name, 1744 ) ); 1750 $signups = BP_Signup::get( 1751 array( 1752 'user_login' => $user_name, 1753 ) 1754 ); 1745 1755 1746 1756 $signup = isset( $signups['signups'] ) && ! empty( $signups['signups'][0] ) ? $signups['signups'][0] : false;
Note: See TracChangeset
for help on using the changeset viewer.