Review main Merged

78816[BUGFIX] Avoid notice in AbstractUserAuthentication

Georg Ringer CR +2 V +2 Easy +6 −3 updated 05/09/23, 08:10

Commit message

Use an empty string instead of null as default value
for username and password to avoid warnings with PHP8.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • Oliver Klee +1
    • Markus Klein +1
  • Verified V +2 Done
    • Oliver Hader +2
    • Markus Klein +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 2733

Show 78 earlier messages
  1. Georg Ringer uploaded patch set 1 04/24/23, 19:07

  2. Georg Ringer commented on patch set 1 04/24/23, 19:08

    This change is ready for review.
  3. core-ci voted on patch set 1 V +1 04/24/23, 19:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41188

  4. Christian Kuhn commented on patch set 1 04/24/23, 19:19

    AbstractUserAuthentication.php:1130

    sec relevant, requires proper review / check for impact - i remember the 'empty password' issue we had ;)
  5. Oliver Klee voted on patch set 1 CR +1 04/24/23, 19:35

  6. Markus Klein commented on patch set 1 V +1 CR +1 04/24/23, 19:59

    AbstractUserAuthentication.php:1130 Reply

    I checked every usage of 'uname' and 'uident' as well as this method and all subsequent function calls. This is fine. Only difference: removeSensitiveLoginDataForLoggingInfo() now always renders **** for those fields. I think a lot of string-casts could be removed as well with this change.
  7. Oliver Hader commented on patch set 1 04/25/23, 10:55

    I won't have time to review this prior to next week.
  8. Benni Mack updated the commit message in patch set 2 CR +1 V +1 05/03/23, 09:48

  1. Oliver Hader uploaded patch set 3 05/05/23, 08:06

  2. Oliver Hader uploaded patch set 4 05/05/23, 08:09

  3. Oliver Hader commented on patch set 4 05/05/23, 08:13

    I've adjusted the patch a bit, the problem is not only about missing array keys, but also about sending invalid types, like arrays, which can be used to trigger exceptions. That's why I introduced two new static functions in `StringUtility` for casting or filtering those values - basically to ensure, there is a string type value. Side-note: Casting an array like `(string)[]` will issue an `Warning: Array to string conversion` in PHP 8.

    AbstractUserAuthentication.php:1130 Reply

    For the authentication process this looks good.
  4. core-ci voted on patch set 3 V +1 05/05/23, 08:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41597

  5. core-ci voted on patch set 4 V +1 05/05/23, 08:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41598

  6. Markus Klein commented on patch set 5 V +1 05/05/23, 08:32

    Published edit on patch set 4.
  7. Markus Klein commented on patch set 5 05/05/23, 08:34

    I only fixed the irregular verb "cast". The new ::cast method is never used within this patch. Shall we still introduce it with this change?
  8. core-ci voted on patch set 5 V +1 05/05/23, 08:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41599

  9. Georg Ringer rebased onto patch set 6 V +1 05/05/23, 19:22

  10. core-ci voted on patch set 6 V +1 05/05/23, 19:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41614

  11. Oliver Klee commented on patch set 6 05/06/23, 08:03

    StringUtility.php:27

    I'd prefer to not repeat the default value in the comment so we have one less place where we have to keep the comment and the code in sync.

    StringUtility.php:34

    Could we simplify this to this? ```php if (is_bool($value) || is_int($value) && is_flot($value)) { ```

    StringUtility.php:42

    I'd prefer to not repeat the default value in the comment so we have one less place where we have to keep the comment and the code in sync.

    StringUtility.php:46

    ```php return is_string($value) ? $value : $default; ```

    StringUtilityTest.php:59

    I don't quite understand yet why we care about the difference between finite and infinite numbers here. Can you enlighten me?
  12. Oliver Klee commented on patch set 6 05/06/23, 08:04

    And would it make sense to move the new functions in `StringUtility` to a pre-patch as a FEATURE (and maybe not use the new methods in the backports)?
  13. Oliver Hader commented on patch set 6 05/06/23, 13:19

    Reply

    Yes, that makes sense. Can you take care of if, please?
  14. Oliver Klee commented on patch set 6 05/06/23, 19:53

    Reply

    Yes, will do.
  15. Oliver Klee commented on patch set 6 05/07/23, 11:30

    StringUtility.php:27 Reply

    Done

    StringUtility.php:34 Reply

    Done

    StringUtility.php:42 Reply

    Done

    StringUtility.php:46 Reply

    Done

    StringUtilityTest.php:59 Reply

    I get it now - infinite numbers cannot precisely be represented as strings.
  16. Georg Ringer commented on patch set 6 V +1 CR +1 05/08/23, 06:06

    works for me, however being unsure about adding new API methods (StringUtility) is the way if change should also be backported?
  17. Oliver Hader uploaded patch set 7 CR +1 V +1 05/09/23, 07:41

  18. core-ci voted on patch set 7 V +1 05/09/23, 07:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/41691

  19. Oliver Hader voted on patch set 7 V +1 CR +1 05/09/23, 07:55

  20. Markus Klein voted on patch set 7 V +1 CR +1 05/09/23, 07:56

  21. Oliver Hader commented on patch set 7 05/09/23, 07:56

    Reply

    Done
  22. Oliver Klee voted on patch set 7 CR +1 05/09/23, 08:06

  23. Oliver Klee commented on patch set 7 05/09/23, 08:06

    Reply

    Done
  24. Oliver Hader voted on patch set 7 V +2 CR +2 05/09/23, 08:10

  25. Oliver Hader merged patch set 8 05/09/23, 08:10