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
F18084416: D21477.diff
Tue, Aug 5, 3:22 PM
Unknown Object (File)
Jun 5 2025, 5:04 PM
Unknown Object (File)
Jun 3 2025, 11:16 AM
Unknown Object (File)
May 7 2025, 7:33 AM
Unknown Object (File)
Apr 30 2025, 11:25 PM
Unknown Object (File)
Apr 28 2025, 4:54 PM
Unknown Object (File)
Apr 27 2025, 11:06 AM
Unknown Object (File)
Apr 26 2025, 11:07 AM
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
Branch
utf8str
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 24935
Build 34402: Run Core Tests
Build 34401: arc lint + arc unit

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.