Homec4science

Fix phutil_is_utf8_with_only_bmp_characters() for partial valid characters

Authored by epriestley <git@epriestley.com> on Feb 24 2014, 20:45.

Description

Fix phutil_is_utf8_with_only_bmp_characters() for partial valid characters

Summary:
We don't get partial 2-byte and 3-byte UTF8 characters quite correct, fataling instead of returning false because we access past the end of the string.

Instead, bail early if we run off the end of the string without seeing any issues.

Test Plan: Added and executed unit tests.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D8321

Details

Committed
epriestley <git@epriestley.com>Feb 24 2014, 20:45
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU4b5c4ad61e00: Remove "supportsStateParameter()" from generic OAuth2 code
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUa1c59161e70b: Fix phutil_is_utf8_with_only_bmp_characters() for partial valid characters (authored by epriestley <git@epriestley.com>).Feb 24 2014, 20:45