WordPress.org

Ready to get started?Download WordPress

Forums

Simple Basic Contact Form
[resolved] Special characters issue (8 posts)

  1. lolobu
    Member
    Posted 8 months ago #

    All the special characters are coming out very funny (well, unreadable unfortunately).
    For instance :

    ' becomes �
    à becomes Ã&

    And so on ...
    It's probably an issue from the last update because I didn't have this sort of issue before.

    PS : Well, those funny characters are "translated" by the editor here so you have to try to see the issue...

    http://wordpress.org/plugins/simple-basic-contact-form/

  2. knighterrantx
    Member
    Posted 8 months ago #

    Same problem here, any solution? It's very anoying, specialy in my language. Have you altered anything in this version thar might cause this problem? thanks

  3. lolobu
    Member
    Posted 8 months ago #

    Ok, I got around it. This appeared with the latest release because it is using now htmlentities to protect against code injection which is great. The side effect however is for people using special characters in their language, everything gets ... funny to say the least.

    Using htmlentities is fine but then, the email has to be send not in play text but in html to make it readable.

    And htmlentities is applied twice which make things even worst.

    So here is my patch:
    Line 114, has to specify UTF-8 encoding. So replace

    $_POST['scf_message']  = htmlentities(stripslashes(trim($_POST['scf_message'])));

    with

    $_POST['scf_message']  = htmlentities(stripslashes(trim($_POST['scf_message'])), ENT_QUOTES, 'UTF-8');

    line 216, send email in html so replace

    $headers  .= "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"";

    with

    $headers  .= "Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"";

    line 218, htmlentities should no be done twice so replace

    $message   = htmlentities($_POST['scf_message']);

    with

    $message   = $_POST['scf_message'];

    line 240, because the email in now in html, has to convert cr into br so replace

    $fullmsg = stripslashes(strip_tags(trim($fullmsg)));

    with

    $fullmsg = nl2br(stripslashes(strip_tags(trim($fullmsg))));

    A last note, I'm nothing like an expert in security so I think this code is ok but no garantie. I'll send this patch to the author and see what he says.

  4. Jeff Starr
    Member
    Plugin Author

    Posted 8 months ago #

    Thanks for the heads up on this thread.. I'll look into the issue for the next update. Specifying the UTF-8 is good and you're correct there is no need for htmlentities() twice, so that also will be addressed. Thanks again.

  5. shippin
    Member
    Posted 1 month ago #

    Hey,

    I'm having issues getting messages in Hebrew using Simple Basic Contact Form. It looks OK inside the email, but the subject line / sender gets garbled.

    I see this thread is 6 months old, has this been fixed in the current version?

    Thanks,
    Jonathan

  6. Jeff Starr
    Member
    Plugin Author

    Posted 1 month ago #

    Should be fixed. Let us know if otherwise and we'll get it in the next update. Thank you.

  7. shippin
    Member
    Posted 1 month ago #

    WOW Thanks for the amazingly fast reply!

    I'm using the latest version, like I wrote the text appears fine INSIDE the email message, but SENDER and SUBJECT becomes gibberish.

    Here's a screenshot of how it looks:
    https://www.dropbox.com/s/xxm45nsrksbdrsy/simple-contact-form.jpg

    Would really appreciate if this can be fixed!

    Another idea - would be great if Success messages and other text like "send button" text could be set from the backend (instead of manually editing the plugin file)

    Thanks for this great plugin!
    Jonathan

  8. Jeff Starr
    Member
    Plugin Author

    Posted 1 month ago #

    Thanks for the feedback, we'll get this fixed up for the next version :)

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.