View Full Version : some php function make me trouble...
skjun
10th of October 2003 (Fri), 07:45
Hello,
I'm testing EE 1.5beta in Korean language,
but some php code makes trouble.
htmlentities() and ucfirst() function with non-English based character return invalid character.
Korean character in Multilingual field also didn't displayed properly, and language files too.
So, I remove some htmlentities() and ucfirst() of some files, and it works fine.
Pekka
10th of October 2003 (Fri), 10:01
skjun wrote:
Hello,
I'm testing EE 1.5beta in Korean language,
but some php code makes trouble.
htmlentities() and ucfirst() function with non-English based character return invalid character.
Korean character in Multilingual field also didn't displayed properly, and language files too.
So, I remove some htmlentities() and ucfirst() of some files, and it works fine.
Thanks for reporting. Are these problems in editors or also in public area?
Can you please specify which places you changed them - I could make them switchable on/off in translate files.
I think there are two issues here:
Htmlentities accepts character sets only after PHP 4.3 and (only with second funtion parameter). This is the reason for htmlentities outputting wrong data.
You can use htmlspecialchars() instead, which does only quotes etc.
And ucfirst, it should follow locale setting, but it seems it may fail. Maybe I'll remove it allogether...
skjun
10th of October 2003 (Fri), 11:53
Thank you, Pekka.
1. header in exhibition setting(multilingual) works fine,
2. but header in photo edit(multilingual) cannot.
I change
htmlentities(ee_stripslashes($key["name"]));
to
ee_stripslashes($key["name"]);
therefore, it works.
3. free textual info in photo editor(multilingual) works fine.
4. in misc. settings, only "Indexpage welcome text" field cannot display.
other multilingual field works fine.
5. all text in language files did not displayed properly.
for example, $translated["camera"] in language file 'global.php' can be displayed
when ee_translate_C() in photodetail.php is removed.
6. In News editor, Header field has no problem. but Newstext field has problem.
Pekka, thanks your reply.
Pekka
13th of October 2003 (Mon), 07:07
Check out 1.5 beta 4 http://photography-on-the.net/forum/showthread.php?t=18564
I've replaced all htmlspecialchars and htmlentities with one function "ee_html_conversion" which is fetchsettings.php. It does only htmlspecialchars (needed for quotes outside tags in html).
I did not touch ucfirst function now, let me know if you will have problems with it. If you want to try without it, just remove it from "ee_translate_A" function in fetchsettings. Same thing with "ee_translate_C" function which has "strtoupper" function.
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.