WordPress.org

Ready to get started?Download WordPress

Forums

Enforce Strong Password
[resolved] Bug Fix: user_login doesn't exist in POST values. (8 posts)

  1. Dan Rossiter
    Member
    Posted 1 year ago #

    In version 3.5.1 the user_value index does not exist in the POST value so line 171 in enforce-strong-password.php is throwing an error. If you change the function to use $current_user->user_login instead, the issue should be resolved.

    The function would look like this with the change described:

    function strong_password_enforcement( $errors ) {
    	extract( $this->get_options() );
    	get_currentuserinfo();
    
    	if ( !$errors->get_error_data("pass")
    	  && $_POST["pass1"]
    	  && $this->get_password_strength( $_POST["pass1"], $current_user->user_login ) < $minimal_required_strength ) {
    		$errors->add(
    			'pass',
    			sprintf(
    				__( 'Please enter a %sstronger%s password to ensure your and this blog\'s security.', self::txd ),
    				"<strong>",
    				"</strong>"
    			)
    		);
    	}
    	return $errors;
    }

    http://wordpress.org/extend/plugins/enforce-strong-password/

  2. Pietro Gregorini
    Member
    Posted 1 year ago #

    Yes, I got the same notice.

    Notice: Undefined index: user_login in /web/htdocs/home/wp-content/plugins/enforce-strong-password/enforce-strong-password.php on line 171

  3. zaantar
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for notifying me, this issue should be fixed in 1.3.3. Please confirm.

  4. Pietro Gregorini
    Member
    Posted 1 year ago #

    Just updated. I got two more notices.
    These are not bugs, the plugin works correctly,
    anyway with debug activated, I got these:

    Notice: Undefined variable: current_user in /web/htdocs/www.positive-magazine.com/home/core/wp-content/plugins/enforce-strong-password/enforce-strong-password.php on line 168
    
    Notice: Trying to get property of non-object in /web/htdocs/www.positive-magazine.com/home/core/wp-content/plugins/enforce-strong-password/enforce-strong-password.php on line 168
  5. Pietro Gregorini
    Member
    Posted 1 year ago #

    By the way, this could help you:
    I got the notices when updating the profile and the password is not strong enough.

  6. zaantar
    Member
    Plugin Author

    Posted 1 year ago #

    Try version 1.3.4.

  7. Pietro Gregorini
    Member
    Posted 1 year ago #

    Perfect! Everything's resolved!
    Thank you very much!

  8. zaantar
    Member
    Plugin Author

    Posted 1 year ago #

    You are welcome. :-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags