WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Bug in user name randomization (v5.2.5) (2 posts)

  1. der-burger
    Member
    Posted 1 year ago #

    Hello,
    first of all thanks for the great plugin. I found a bug in the em-actions.php file (about line 250). The original is

    $username_root = explode('@', $_REQUEST['user_email']);
    $username_rand = $username_root[0].rand(1,1000);
    while( username_exists($username_root[0].rand(1,1000)) ){
      $username_rand = $username_root[0].rand(1,1000);
    }

    The user name that is checked is not the user name that is used afterwards! It's unlikely that this leads to conflicts, but it might happen. I corrected it like this in my installation, and implemented my original intent of providing a non-random user name if possible:

    $username_root = explode('@', $_REQUEST['user_email']);
    $username_rand = $username_root[0];
     while( username_exists($username_rand) ) {
      $username_rand = $username_root[0].rand(1,1000);
    }

    Have fun,
    Markus

    http://wordpress.org/extend/plugins/events-manager/

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    Thanks, you're right and this is an improvement too! Will change this.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic