WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. lolobu
    Member
    Posted 11 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 11 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 11 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 11 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 4 months 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 4 months ago #

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

  7. shippin
    Member
    Posted 4 months 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 4 months ago #

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

  9. shippin
    Member
    Posted 2 months ago #

    Hey Jeff,

    Sorry to bother you again but I'm still having difficulty receiving emails from senders which write their names in Hebrew.

    In the content of the email everything appears fine, just in the email "sender name" field the display is broken, see screenshot:
    https://www.dropbox.com/s/z8t725rb41ccfrq/SBCF-screenshot.jpg

    Can you please tell me which line should I edit in the simple-basic-contact-form.php file to have the sender "name" in emails be some default english text like "Website visitor" instead of the user name as he types it?

    Thanks,
    Jonathan

  10. shippin
    Member
    Posted 2 months ago #

    Hey Jeff,

    Any chance you can just quickly tell me where is the *sender* name configured in the php file? I want to change it to some default text until there's a fix to the encoding issue..

    Right now all the contact form messages are filtred as spam :(

    Thanks,
    Jonathan

  11. shippin
    Member
    Posted 2 months ago #

    Hey,

    I found it on line 225!

    Thanks,
    Jonathan.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.