Guarantee terms in PhabricatorAuthPasswordEngine are strings
commitae5a38f3349fdd718033619c4e908137f1634502
authorepriestley <git@epriestley.com>
Tue, 3 Nov 2020 18:32:26 +0000 (3 10:32 -0800)
committerepriestley <git@epriestley.com>
Tue, 3 Nov 2020 19:04:49 +0000 (3 11:04 -0800)
tree29e3cb913f03c17f4e803d0afbce2c103a725804
parentc04147328fa3006c75b6a669d6c0e6ecb335be01
Guarantee terms in PhabricatorAuthPasswordEngine are strings

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.

Maniphest Tasks: T2312

Differential Revision: https://secure.phabricator.com/D21487
src/applications/auth/engine/PhabricatorAuthPasswordEngine.php