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
Unknown Object (File)
Sat, Dec 28, 5:11 PM
Unknown Object (File)
Tue, Dec 24, 2:36 AM
Unknown Object (File)
Sat, Dec 21, 5:48 PM
Unknown Object (File)
Sun, Dec 15, 2:45 PM
Unknown Object (File)
Dec 10 2024, 11:04 PM
Unknown Object (File)
Nov 28 2024, 10:11 AM
Unknown Object (File)
Nov 22 2024, 5:06 AM
Unknown Object (File)
Oct 9 2024, 1:41 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.