in reply to Re: CGI hidden params vs. character encoding
in thread CGI hidden params vs. character encoding
First of all, decode( 'utf8', $untrusted ) is a security issue.
Wouldn't that depend on what you do with the value that you get back from decode()? Also, what would be the remedy? I would expect it's okay to do something like eval { decode( 'UTF-8', $untrusted, Encode::FB_CROAK ) } and check $@, or maybe just pass the return value from decode() through a regex or other test for valid content.
Secondly, UTF8 is a perl-specific encoding. UTF-8 is the actual encoding.I haven't pinpointed the problem, but changing UTF8 to UTF-8 throughout fixed the problem.
Okay... I had to try twice -- I didn't get all the "utf8" strings changed over to "UTF-8" on the first try, but after I fixed the one I had forgotten ("binmode STDOUT..."), it worked. How strange...
Thanks!!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: CGI hidden params vs. character encoding
by ikegami (Patriarch) on May 27, 2008 at 23:31 UTC | |
by graff (Chancellor) on May 28, 2008 at 00:41 UTC | |
by ikegami (Patriarch) on May 28, 2008 at 01:24 UTC |