Skip to:
Content
Pages
Categories
Search
Top
Bottom

New User – Invalid Key – The Solution


  • Antimuffin
    Participant

    @antimuffin

    Hello,

    i have seen that many people have the Problem that the User can´t Activate via Email, cause of the “Invalid Key” exception..

    I solved the Problem in my System, this is only a Temorary Solution, it can be lost after a BuddyPress Update ( I hope the Admin fixed this problem by the next Update):

    You only have to go in \wp-content\plugins\buddypress\bp-members\bp-members-functions.php at Line 1781 and put // before ‘ $activate_url = esc_url( $activate_url ); ‘
    => //$activate_url = esc_url( $activate_url );

    The Problem is to use esc_url();
    the link befor esc_url():
    example.com/?key=763640d2d5f5ab0fa7f88b8559d84ec0
    and after esc_url():
    example.com/?key=763640d2d5f5ab0fa7f88b8559d84ec0

    Yes this looks simular, but it isnt.. if i convert it so ANSI you will see it:
    example.com/?key=763640d2d5f5ab0fa7f88b8559d84ec0

    That is the solution for the “Invalid Key” Exception…

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

  • Antimuffin
    Participant

    @antimuffin

    Second Solution:

    You only have to go in \wp-content\plugins\buddypress\bp-members\bp-members-functions.php at Line 1779 and now you change:

    $activate_url = bp_get_activation_page() .”?key=$key”;

    to:

    $activate_url = bp_get_activation_page() .”?key=$key&welcome=true”;

    or Something else.. but its very important that you add it after the $key..
    Now it works too !


    r-a-y
    Keymaster

    @r-a-y

    @antimuffin – Thanks for looking into this.

    Can you try one thing? Can you change esc_url() to esc_url_raw() and see if that fixes things as well?


    Antimuffin
    Participant

    @antimuffin

    I tried it, but it doesnt work, the Problem is that after esc_url() /esc_url_raw() you have a BOM (Byte Order Mark) after the String… :/


    r-a-y
    Keymaster

    @r-a-y

    @antimuffin – I tried duplicating this, but can’t.
    I have a few other questions:

    • Are you using a different language other than en_US for your WordPress install?
    • Are you using any email plugins? Specifically, are you using a plugin that converts the plain-text email over to HTML? If so, this might be where the problem lies.
    • How did you access the activation email? Webmail? Email client?
    • What is the default character encoding in your email client? Mine is Unicode. I tried converting the character encoding over to Western (ISO-8859-1) and Western (Windows-1252) and couldn’t duplicate the problem. Note that this is for the default plain-text activation email. How are you converting the email over to ANSI?

    Any other feedback would be useful.


    r-a-y
    Keymaster

    @r-a-y

    Can you also try replacing esc_url() with wp_sanitize_redirect() first and wp_validate_redirect() afterwards?

    We’ll probably remove the esc_url() function since our emails are sent out in plain-text at the moment anyway so using esc_url() isn’t necessary. But, if you are using HTML email, then another solution will be needed.


    Antimuffin
    Participant

    @antimuffin

    Hallo r-a-y,
    no i am not useing the en_US language , i am useing the de_DE language for WordPress and Buddypress. No i havent installed any Email Plugins. It is Unicode too. I will do..


    r-a-y
    Keymaster

    @r-a-y

    @antimuffin (or anyone else) – Can you try the fix I posted here?

    https://buddypress.trac.wordpress.org/ticket/5831#comment:3

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘New User – Invalid Key – The Solution’ is closed to new replies.
Skip to toolbar