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)
Sun, Dec 1, 4:03 AM
Unknown Object (File)
Sun, Dec 1, 1:36 AM
Unknown Object (File)
Tue, Nov 26, 11:58 PM
Unknown Object (File)
Fri, Nov 22, 9:40 PM
Unknown Object (File)
Mon, Nov 18, 3:41 PM
Unknown Object (File)
Fri, Nov 15, 9:11 AM
Unknown Object (File)
Sun, Nov 10, 5:33 AM
Unknown Object (File)
Tue, Nov 5, 11:57 PM
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
Branch
str1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 24957
Build 34434: Run Core Tests
Build 34433: arc lint + arc unit

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.