[wp-trac] [WordPress Trac] #11738: sanitize_text_field() issue with UTF-8 characters
WordPress Trac
wp-trac at lists.automattic.com
Wed Jan 6 12:41:53 UTC 2010
#11738: sanitize_text_field() issue with UTF-8 characters
--------------------------+-------------------------------------------------
Reporter: hakre | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.9.2
Component: General | Version: 2.9.1
Severity: normal | Keywords: needs-patch
--------------------------+-------------------------------------------------
Comment(by hakre):
Replying to [comment:2 westi]:
> Also you assume that the string is UTF8 by using the "u" modifier what
about people using a different charset?
I suggested in the other ticket to check the encoding prior to apply the
replace operation on it. we have a seems_utf8() function that could do the
job and I referenced more code that even does the job properly to validate
if input is properly utf8 encoded. For any other encoding, we can handle
it as we did: just with a best guess and a preg_replace w/o the
u-modifier.
Please do not read that I want to speak against other encodings, but
factually it's not taken much care about input encoding in the wp
codebase.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11738#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list