Page MenuHomePhabricator

Fix an issue where "phutil_utf8v()" could fatal when passed an integer
ClosedPublic

Authored by epriestley on Oct 16 2020, 4:20 PM.
Tags
None
Referenced Files
F15580759: D21477.id51120.diff
Wed, May 7, 7:33 AM
F15565157: D21477.id51120.diff
Wed, Apr 30, 11:25 PM
F15556483: D21477.id51121.diff
Mon, Apr 28, 4:54 PM
F15550325: D21477.id.diff
Sun, Apr 27, 11:06 AM
F15545513: D21477.diff
Sat, Apr 26, 11:07 AM
F15467649: D21477.diff
Apr 3 2025, 5:13 PM
F15451789: D21477.id51120.diff
Mar 28 2025, 11:47 PM
F15450636: D21477.id.diff
Mar 28 2025, 4:48 PM
Subscribers
None

Details

Summary

See https://discourse.phabricator-community.org/t/search-by-name-in-files-doesnt-support-number/4300.

I can't exactly reproduce the original issue, but when a query like "quack 1234" is tokenized, we end up calling "phutil_utf8v(1234)", where the argument is an integer.

At least in recent versions of PHP, this fatals ("trying to access an offset of an integer"). Cast the argument first.

Test Plan

Searched for "quack 1234" in Files. Before: fatal accessing offset of integer; after: correct results.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Oct 16 2020, 4:20 PM
epriestley requested review of this revision.
This revision was automatically updated to reflect the committed changes.