Forums

[Plugin: Gwolle-GB] Problems with Croatian chars in messages (16 posts)

  1. dardana
    Member
    Posted 3 years ago #

    Hello,
    first I want to congratulate you on an excellent plugin - I tried several plugins before choosing yours on my site http://www.mymarisa.org.

    However, I experienced some problems when submiting text in Croatian, with Croatian-specific charachters (čćžšđ). By clicking on Submit button I got following error messages:

    "Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in .../wp-content/plugins/gwolle-gb/frontend/do-saveNewEntry.php on line 51

    Warning: Cannot modify header information - headers already sent by (output started at .../wp-content/plugins/gwolle-gb/frontend/do-saveNewEntry.php:51) in .../wp-content/plugins/gwolle-gb/frontend/do-saveNewEntry.php on line 187"

    When I remove those characters, the text saves without problems and I got the confirmation message.

    Thank you for your help...

  2. gwolle
    Member
    Posted 3 years ago #

    Hey dardana,
    I'm glad you like my plugin. Unfortunately there seems to be some strange behaviour on the MySQL-side of view. I was able to reproduce the error message by myself. I also got some question marks when I tried to save those characters directly to the database via PHPMyAdmin. I believe it's a problem on the MySQL-side. You may add a @ in line 51, so that it says:
    if (@mysql_num_rows($doublePost_result) > 0) {
    That will prevent the system from throwing an error message, but as I experienced the messages aren't displayed correctly in the backend.
    Do you have issues when writing text in croatian language?

    Greetings
    Wolfgang

  3. agshar
    Member
    Posted 3 years ago #

    I have similar problem, using Polish characters this time. No errors were displayed, but specific letters change in question marks.
    I solved it partially: your (plugin's) tables are set to latin1-swedish character set by default, I've changed them to utf8-general and in database they look as they should, but on blog still show as question marks.
    I'll try to investigate it further tomorrow.

    GReg

  4. dardana
    Member
    Posted 3 years ago #

    Hi, I tried what agshar suggested (changing to utf-8 in the databse) and got the same result - in databse the entry looks right, with čćžšđ characters, but on the website it stands with question marks: http://www.mymarisa.org/knjiga-gostiju/

    I guess we are close to solution... ;)

  5. gwolle
    Member
    Posted 3 years ago #

    Hey guys,
    that may be the solution to the problem:

    • Altering the entries-table and it's columns to utf8_general_ci.
    • Everytime we have an output from that table we use html_entity_decode(stripslashes($THE_STRING), 0, 'UTF-8').

    This does this trick at my local installation. Could you please check at your ones? If your results are positive I'll post an update.

    Thank you very much for your help! I really appreciate your enthusiasm and your believe in this plugin. Thanks!

    Greetings from cloudy Hamburg
    Wolfgang

  6. gwolle
    Member
    Posted 3 years ago #

    By the way: dardana, would you mind sending me your Croatian language file? Is it fully translated or only the frontend? I'd love to upload it within the next release, so that other users can use it, too.

    Thanks in advance!
    Wolfgang

  7. agshar
    Member
    Posted 3 years ago #

    Ok,
    here is what I found:

    in what you used to print entries:
    echo stripslashes(htmlentities(utf8_decode($entry['entry_content']))

    I removed htmlentities and utf8_decode completely, thus leaving only:
    echo stripslashes($entry['entry_content']);

    that combined with UTF8 coding set in database tables solves the problem.

    I have done similar in frontend/read.php lines 149 (author name), and 158 (entry content); and in admin/entries.php lines 291 (content) and 304 (author name).

    I am not exactly an expert, but I guess it will work fine in most languages.

    It works for me, so I am happy now ;) hope it helps you as well.

    Thanks,
    GReg

  8. agshar
    Member
    Posted 3 years ago #

    Found one more:

    admin/editor.php line 197 - remove htmlentities and utf8_decode - that fixes entry editor.
    Is that it, or am I missing something else?

    GReg

  9. gwolle
    Member
    Posted 3 years ago #

    Hey guys,
    that will do the job, except that someone can insert plain HTML in the message, and then may e. g. exit your <textarea> and print some HTML, let's say an error message or else. Removing htmlentities is NOT recommended. If you do remove it you open a gate for hackers. Please don't go this way.
    I'd like you to try out my solution and then give me feedback if it worked. Thanks in advance!

    Wolfgang

  10. dardana
    Member
    Posted 3 years ago #

    Hi gwole and sorry for my late reply.

    For now I decided to use simpler method - adjusted contact form and manual entry of people's messages. This method satisfies my needs for now, because there are not so many entries at the moment...

    Thank you for your effort anyway.

  11. agshar
    Member
    Posted 3 years ago #

    Hi,

    Finally had a minute to check, sorry it was so long. Your way works just fine Gwolle. I didn't think about security really, and as i said I am far from being expert.
    Thanks for your help.

    GReg

  12. gwolle
    Member
    Posted 3 years ago #

    Hey agshar,
    I just uploaded a new version (0.9.4.5) and included the fixes. Thank you all very much for your help, you're inspiring! :)

    Worm greetings from Germany,
    Wolfgang

  13. Fango
    Member
    Posted 2 years ago #

    Hello Gwolle ....

    I'm a rookie in php .... I've the same problem with
    the plugin by saving new entries ...

    "wp-content/plugins/gwolle-gb/frontend/do-saveNewEntry.php on line ..."

    I dont know whats happend there ...

    using the new Plugin version (0.9.4.5) and wordpress 2.8.4 ( DE )

    Please help me ....

    kalle

  14. Fango
    Member
    Posted 2 years ago #

    the message is :

    Warning: cannot yet handle MBCS in html_entity_decode()! in /www/htdocs/dlksmd/wp-content/plugins/gwolle-gb/admin/entries.php on line 291

    and also ...

    Warning: cannot yet handle MBCS in html_entity_decode()! in /www/htdocs/dlksmd/wp-content/plugins/gwolle-gb/admin/entries.php on line 304

    what can i do ?

    Kalle

  15. gwolle
    Member
    Posted 2 years ago #

    Hello everyone,

    I removed the changes, because it caused a lot of trouble. I hope you guys with croazian letters are able to see/insert them. (Leave me a not if not.) Everyone else should not get the error message anymore with the latest update.

    Thanks for you patience!
    Wolfgang

  16. Don Daniello
    Member
    Posted 2 years ago #

    Polish letters still don't work (question marks appear), but only in frontend, everywhere else (admin area) it looks fine.

Topic Closed

This topic has been closed to new replies.

About this Topic