WordPress.org

Ready to get started?Download WordPress

Forums

Mozilla Persona (BrowserID)
[resolved] [Plugin: Mozilla BrowserID] [Plugin: BrowserID] Redirect Bug? (3 posts)

  1. marv51
    Member
    Posted 2 years ago #

    Hi Marcel,

    I think I found a bug in the way the plugin redirects. When I go to domain.com/wp-admin/
    I get redirected to http://domain.com/wp-login.php?redirect_to=http%3A%2F%2Fdomain.com%2Fwp-admin%2F&reauth=1
    Now after I signed I with BrowserID I would get redirected to http://domain.com/%2Fwp-admin%2F or http://domain.com/http%3A%2F%2Fdomain.com%2Fwp-admin%2F both ways get 404-errors.

    The bug seems to be fixed by adding urldecode() to the redirect_to.
    In Handle_login():
    $redirect_to = urldecode($_REQUEST['redirect_to']);

    But, I'm not sure this is a good fix, because the PHP manual says to not call it on $_REQUEST.(http://php.net/manual/en/function.urldecode.php)

    Kind regards,

    Marvin

    http://wordpress.org/extend/plugins/browserid/

  2. marv51
    Member
    Posted 2 years ago #

    I'm not sure what is going on here, this is very confusing. But this hasn't occurred with the latest development version.
    So resolved.

  3. Lwangaman
    Member
    Posted 1 year ago #

    I think I found the problem, because redirect always goes to wp-admin even if I set it in the options to the homepage.
    In the function "Handle_login()", I tried:

    $string = var_export($options);
    die($string);

    to see the value of $options, and it was NULL !
    I think you forgot to call:
    $options = get_option('browserid_options');
    at the beginning of the function "Handle_login()", as you do in other functions. In fact, adding that line, as so:

    function Handle_login($result, $rememberme) {
      $options = get_option('browserid_options');

    fixed everything for me. Now $options is a valid array, and the redirect works perfectly.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.