Title: [Plugin: Register Plus] Validations not work correct
Last modified: August 19, 2016

---

# [Plugin: Register Plus] Validations not work correct

 *  [roonex](https://wordpress.org/support/users/roonex/)
 * (@roonex)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/plugin-register-plus-validations-not-work-correct/)
 * I found one trouble – users can register if they just type spaces for first and
   second name. This is now right and I change some code for not allowing this. 
   In row 989 in register-plus.php file I change this if statement:
    if(empty($_POST[‘
   firstname’]) || $_POST[‘firstname’] == ”) with this: if(trim($_POST[‘firstname’])
   == ”)
 * and same for the last name.
 * So I just want to ask the author of the plugin to fix this in the future versions.
   
   Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [WebDev WaxLotus LLC](https://wordpress.org/support/users/musnake/)
 * (@musnake)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/plugin-register-plus-validations-not-work-correct/#post-889893)
 * May as well change the rest too…
 * Plugin Version: 3.5.1
    ~line 990-something
 *     ```
       if( $regplus['firstname'] && in_array('firstname', $regplus['profile_req']) ){
       				if(trim($_POST['firstname']) == ''){
       					$errors->add('empty_firstname', __('<strong>ERROR</strong>: Please enter your First Name.', 'regplus'));
       				}
       			}
       			if( $regplus['lastname'] && in_array('lastname', $regplus['profile_req']) ){
       				if(trim($_POST['lastname']) == ''){
       					$errors->add('empty_lastname', __('<strong>ERROR</strong>: Please enter your Last Name.', 'regplus'));
       				}
       			}
       			if( $regplus['website'] && in_array('website', $regplus['profile_req']) ){
       				if(trim($_POST['website']) == ''){
       					$errors->add('empty_website', __('<strong>ERROR</strong>: Please enter your Website URL.', 'regplus'));
       				}
       			}
       			if( $regplus['aim'] && in_array('aim', $regplus['profile_req']) ){
       				if(trim($_POST['aim']) == ''){
       					$errors->add('empty_aim', __('<strong>ERROR</strong>: Please enter your AIM username.', 'regplus'));
       				}
       			}
       			if( $regplus['yahoo'] && in_array('yahoo', $regplus['profile_req']) ){
       				if(trim($_POST['yahoo']) == ''){
       					$errors->add('empty_yahoo', __('<strong>ERROR</strong>: Please enter your Yahoo IM username.', 'regplus'));
       				}
       			}
       			if( $regplus['jabber'] && in_array('jabber', $regplus['profile_req']) ){
       				if(trim($_POST['jabber']) == ''){
       					$errors->add('empty_jabber', __('<strong>ERROR</strong>: Please enter your Jabber / Google Talk username.', 'regplus'));
       				}
       			}
       			if( $regplus['about'] && in_array('about', $regplus['profile_req']) ){
       				if(trim($_POST['about']) == ''){
       					$errors->add('empty_about', __('<strong>ERROR</strong>: Please enter some information About Yourself.', 'regplus'));
       				}
       			}
       			if (!empty($regplus_custom)) {
       				foreach( $regplus_custom as $k=>$v ){
       					if( $v['required'] && $v['reg'] ){
       						$id = $this->Label_ID($v['label']);
       						if(trim($_POST[$id]) == ''){
       							$errors->add('empty_' . $id, __('<strong>ERROR</strong>: Please enter your ' . $v['label'] . '.', 'regplus'));
       						}
       					}
       				}
       			}
   
       			if ( $regplus['password'] ){
       				if(trim($_POST['pass1']) == '' || trim($_POST['pass2']) == ''){
       					$errors->add('empty_password', __('<strong>ERROR</strong>: Please enter a Password.', 'regplus'));
       				}elseif($_POST['pass1'] !== $_POST['pass2']){
       					$errors->add('password_mismatch', __('<strong>ERROR</strong>: Your Password does not match.', 'regplus'));
       				}elseif(strlen($_POST['pass1'])<6){
       					$errors->add('password_length', __('<strong>ERROR</strong>: Your Password must be at least 6 characters in length.', 'regplus'));
       				}else{
       					$_POST['user_pw'] = $_POST['pass1'];
       				}
       			}
       			if ( $regplus['code'] && $regplus['code_req'] ){
       				if(trim($_POST['regcode']) == ''){
       					$errors->add('empty_regcode', __('<strong>ERROR</strong>: Please enter the Invitation Code.', 'regplus'));
       				}elseif( !in_array(strtolower($_POST['regcode']), $regplus['codepass']) ){
       					$errors->add('regcode_mismatch', __('<strong>ERROR</strong>: Your Invitation Code is incorrect.', 'regplus'));
       				}
       			}
   
       			if ( $regplus['captcha'] == 1 ){
       ```
   
 *  [WebDev WaxLotus LLC](https://wordpress.org/support/users/musnake/)
 * (@musnake)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/plugin-register-plus-validations-not-work-correct/#post-889894)
 * I also added this clarifying label+statement to the reCaptcha section:
 *     ```
       $publickey = $regplus['reCAP_public_key'];
   
       				?><label>Anti-Spam</label><p>(Characters are case-insensitive)</p><?php
   
       				echo '<div id="reCAPTCHA">';
       				echo rp_recaptcha_get_html($publickey);
       				echo '</div>&nbsp;<br />';
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Register Plus] Validations not work correct’ is closed to new
replies.

 * 2 replies
 * 2 participants
 * Last reply from: [WebDev WaxLotus LLC](https://wordpress.org/support/users/musnake/)
 * Last activity: [17 years, 5 months ago](https://wordpress.org/support/topic/plugin-register-plus-validations-not-work-correct/#post-889894)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
