WordPress.org

Ready to get started?Download WordPress

Forums

MailPoet Newsletters
[resolved] [Plugin: Wysija Newsletters] Problem with "&" in links (10 posts)

  1. crashtest
    Member
    Posted 2 years ago #

    Hi,

    there is a problem when a "&" is present in a link.

    Checking it in newsletter editor the link is correct (a phpbb forum link), but when you click it in the email you receive, in the browser address the "&" is changed in "&", causing the phpbb message "this argument doesn't exist etc.".

    correct link: ...viewtopic.php?f=27&t=339

    wrong link generated by wysija: ...viewtopic.php?f=27&t=339

    http://wordpress.org/extend/plugins/wysija-newsletters/

  2. MailPoet Staff
    Member
    Plugin Author

    Posted 2 years ago #

    Hello,

    thanks for the feedback.

    You mean ampersand "&" are encoded as "&".

    Correct? Let us know! Kim

  3. crashtest
    Member
    Posted 2 years ago #

    lol,

    realized only after your email that this forum changed the code of &, so... again:

    Checking it in newsletter editor the link is correct (a phpbb forum link), but when you click it in the email you receive, in the browser address the "&" is changed in:
    "&",

    causing the phpbb message "this argument doesn't exist etc.".

    correct link: ...viewtopic.php?f=27&t=339

    wrong link generated by wysija: ...viewtopic.php?f=27&t=339

  4. crashtest
    Member
    Posted 2 years ago #

    ok, even if between the tag "code" the result is the same hahaha

    again (now with spaces):

    correct link: ...viewtopic.php?f=27&t=339

    wrong link generated by wysija: ...viewtopic.php?f=27 & a m p ; t=339

  5. MailPoet Staff
    Member
    Plugin Author

    Posted 2 years ago #

    Hehe. The forum here is encoding all our &_amp; as "&" :-)

    Anyway, I understand what you mean.

    Thanks for the bug report. I confirm we have the same issue on our tests sites.

  6. Chandle
    Member
    Posted 2 years ago #

    It seems a solution for this is to open wysija-newsletters/controllers/front/stats.php file and

    Find:

    $this->redirect($decodedUrl);

    and replace with:

    $this->redirect(html_entity_decode($decodedUrl));

  7. Ben
    Member
    Plugin Author

    Posted 2 years ago #

    Hi,

    Here is a fix for the redirection error.

    Juste replace the file wysija-newsletters/controller/front/stats.php with the one zipped here:

    http://support.wysija.com/files/2012/04/stats2.zip

    Let me know
    Cheers,
    Ben

  8. crashtest
    Member
    Posted 2 years ago #

    it works! thank you for your quick support Ben ;)

  9. Chandle
    Member
    Posted 2 years ago #

    I dig a little bit deeper and maybe a better fix (than modifying stats.php file as described in my original post) is to fix it in wysija-newsletters/helpers/mailer.php file:

    Find:

    $urlencoded=urlencode(base64_encode($v));

    Replace with:

    $urlencoded=urlencode(base64_encode(html_entity_decode($v)));

    Find:

    $urlencoded=urlencode(base64_encode($urlreuse));

    Replace with:

    $urlencoded=urlencode(base64_encode(html_entity_decode($urlreuse)));

  10. Ben
    Member
    Plugin Author

    Posted 2 years ago #

    Well spotted Chandle :)

    Indeed the source of the problem is there.

    But for sent newsletter the stats.php fix is important.

    Cheers,
    Ben

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic