Home » HTML » HTML_AJAX » Bug #8183
JS form sending code is LATIN only
Details
| Submitted | 2006-07-11 17:00 UTC |
|---|---|
| From | greg at claranet dot fr |
| Assigned | jeichorn |
| Status | Closed |
| Package | HTML_AJAX |
| PHP Version | 4.3.10 |
| OS | independent |
| Roadmaps | (Not assigned) |
Comments
[2006-07-11 17:00 UTC] greg at claranet dot fr
Description:
------------
In the javascript code, the method "formEncode" uses the "escape" function which is ISO-8850 only. That implies all data sent are incorrectly encoded if the page is using another encoding (such as UTF), and therefore the data should be converted when received or could be considered corrupted.
To avoid that, you should change line 327 of HTML_AJAX.js
from
value = escape(el.value);
to
value = encodeURI(el.value);
I'm not sure about the other occurences of calling 'escape', though.
Test script:
---------------
escape('é');
Expected result:
----------------
%C3%A9
Actual result:
--------------
%E9
[2006-07-11 17:25 UTC] jeichorn at php dot net
Fixed in svn, I can provide a 0.5.0pre pearball if you need it
[2006-07-11 23:08 UTC] greg at claranet dot fr
>Fixed in svn, I can provide a 0.5.0pre pearball if you need it
yes please :)
greg
[2006-07-11 23:17 UTC] jeichorn at php dot net
formEncode is fixed but post hasn't been yet (new method in 0.5.0)
http://bluga.net/projects/HTML_AJAX/HTML_AJAX-0.4.9.1.tgz
This is a preview release so let me know if you have any problems
[2006-08-09 05:38 UTC] jeichorn at php dot net
Fix in svn thanks