Page MenuHomePhorge

Validate PhabricatorSearchTextField value not to be an array
ClosedPublic

Authored by aklapper on Jan 17 2024, 15:06.
Tags
None
Referenced Files
F2187943: D25519.1715540341.diff
Sat, May 11, 18:59
Unknown Object (File)
Tue, May 7, 08:13
Unknown Object (File)
Sat, May 4, 14:22
Unknown Object (File)
Sat, May 4, 14:22
Unknown Object (File)
Sat, May 4, 13:24
Unknown Object (File)
Sat, May 4, 12:30
Unknown Object (File)
Thu, Apr 25, 22:37
Unknown Object (File)
Wed, Apr 17, 18:20

Details

Summary

PhabricatorSearchTextField.php's parent class PhabricatorSearchField.php defines an (empty) protected function validateControlValue($value).
Override this function in PhabricatorSearchTextField.php by disallowing arrays (as the only data type which cannot be casted into a text value).

Closes T15714

Test Plan

Apply D25518; then manually edit the code in ManiphestTaskSearchEngine.php by defining an array and passing that array to the Page Size text field via id(new PhabricatorSearchTextField())->setDefaultValue($empty_array), then go to /maniphest/query/advanced/ and see the error message.

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable