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)
Sat, Apr 6, 3:23 PM
Unknown Object (File)
Tue, Apr 2, 12:42 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)
Wed, Mar 27, 2:03 AM
Unknown Object (File)
Mar 10 2024, 12:00 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
Branch
str1
Lint
Lint Errors
SeverityLocationCodeMessage
Errorsrc/__tests__/PhabricatorCelerityTestCase.php:15PHL1Unknown Symbol
Errorsrc/__tests__/PhabricatorCelerityTestCase.php:29PHL1Unknown Symbol
Errorsrc/__tests__/PhabricatorConduitTestCase.php:6PHL1Unknown Symbol
Errorsrc/__tests__/PhabricatorConduitTestCase.php:6PHL1Unknown Symbol
Errorsrc/__tests__/PhabricatorInfrastructureTestCase.php:18PHL1Unknown Symbol
Errorsrc/__tests__/PhabricatorLibraryTestCase.php:3PHL1Unknown Symbol
Errorsrc/applications/auth/engine/PhabricatorAuthPasswordEngine.php:4PHL1Unknown Symbol
Errorsrc/applications/auth/engine/PhabricatorAuthPasswordEngine.php:58PHL1Unknown Symbol
Errorsrc/applications/auth/engine/PhabricatorAuthPasswordEngine.php:67PHL1Unknown Symbol
Errorsrc/applications/auth/engine/PhabricatorAuthPasswordEngine.php:84PHL1Unknown Symbol
Errorsrc/applications/auth/engine/PhabricatorAuthPasswordEngine.php:150PHL1Unknown Symbol
Errorsrc/applications/auth/engine/PhabricatorAuthPasswordEngine.php:175PHL1Unknown Symbol
Errorsrc/applications/auth/engine/PhabricatorAuthPasswordEngine.php:188PHL1Unknown Symbol
Errorsrc/applications/auth/engine/PhabricatorAuthPasswordEngine.php:276PHL1Unknown Symbol
Errorsrc/applications/auth/engine/PhabricatorAuthPasswordEngine.php:313PHL1Unknown Symbol
Errorsrc/applications/auth/engine/PhabricatorAuthPasswordEngine.php:344PHL1Unknown Symbol
Errorsrc/view/AphrontDialogView.php:97PHL1Unknown Symbol
Errorsrc/view/AphrontDialogView.php:158PHL1Unknown Symbol
Errorsrc/view/AphrontView.php:6PHL1Unknown Symbol
Errorsrc/view/AphrontView.php:37PHL1Unknown Symbol
Errorsrc/view/AphrontView.php:110PHL1Unknown Symbol
Errorsrc/view/extension/PHUICurtainExtension.php:3PHL1Unknown Symbol
Errorsrc/view/extension/PHUICurtainExtension.php:30PHL1Unknown Symbol
Errorsrc/view/extension/PHUICurtainExtension.php:38PHL1Unknown Symbol
Errorsrc/view/extension/PHUICurtainExtension.php:38PHL1Unknown Symbol
Unit
Tests Passed
Build Status
Buildable 24956
Build 34432: Run Core Tests
Build 34431: 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.