Page MenuHomePhabricator

Guarantee terms in PhabricatorAuthPasswordEngine are strings
ClosedPublic

Authored by epriestley on Nov 3 2020, 6:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Mar 27, 2:03 AM
Unknown Object (File)
Wed, Mar 27, 2:03 AM
Unknown Object (File)
Wed, Mar 27, 2:03 AM
Unknown Object (File)
Wed, Mar 27, 2:03 AM
Unknown Object (File)
Wed, Mar 27, 2:03 AM
Unknown Object (File)
Sun, Mar 10, 12:00 AM
Unknown Object (File)
Jan 27 2024, 6:37 AM
Unknown Object (File)
Nov 30 2023, 1:37 AM
Subscribers
None

Details

Summary

Ref T2312. Numeric strings are read out of arrays as integers, and modern PHP raises appropriate warnings when they're then treated as strings.

For now, cast the keys to strings explicitly (we know we inserted only strings). In the future, introduction of a StringMap type or similar might be appropriate.

Test Plan
  • Added "abc.12345.xyz" to the blocklist, changed my VCS password.
  • Before: fatal when trying to "strpos()" an integer.
  • After: password change worked correctly.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Nov 3 2020, 7:04 PM
This revision was automatically updated to reflect the committed changes.