HomePhabricator

Fix phutil_is_utf8_with_only_bmp_characters() for partial valid characters

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

Provenance
epriestleyAuthored on
epriestleyPushed on Feb 24 2014, 7:45 PM
Reviewer
btrahan
Differential Revision
D8321: Fix phutil_is_utf8_with_only_bmp_characters() for partial valid characters
Parents
rPHU4b5c4ad61e00: Remove "supportsStateParameter()" from generic OAuth2 code
Branches
Unknown
Tags
Unknown

Event Timeline