Review main Merged

72740[BUGFIX] Remove useless string cast of idn_to_ascii()

Andreas Kienast CR +2 V +2 Easy +1 −1 updated 12/20/21, 22:04

Commit message

The function `idn_to_ascii()` will return either `false` or a string,
the former one is returned on errors. In #93900, the result was cast to
string, making the check for `false` useless.

As `idn_to_ascii()` can return both, the string cast is removed to make
the check for `false` functional again.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Oliver Klee +1
    • Stefan Bürk +1
    • Christian Kuhn +1
    • Nikita Hovratov +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Stefan Bürk +1
    • Christian Kuhn +1
    • Nikita Hovratov +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 1012

  1. Andreas Kienast uploaded patch set 1 12/20/21, 14:29

  2. Andreas Kienast updated the commit message in patch set 2 12/20/21, 14:30

  3. Oliver Klee voted on patch set 2 CR +1 12/20/21, 14:46

  4. core-ci voted on patch set 2 V +1 12/20/21, 14:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21291

  5. core-ci voted on patch set 1 V +1 12/20/21, 14:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/21290

  6. Oliver Klee commented on patch set 2 12/20/21, 15:06

    Should we cover this fix with a regression test?
  7. Andreas Kienast commented on patch set 2 12/20/21, 15:18

    Reply

    I would if I could find any input to trigger this.
  8. Nikita Hovratov commented on patch set 2 V +1 CR +1 12/20/21, 19:56

    https://github.com/php/php-src/blob/47f430dbdbcbe31f6cc7949e356e5e2f85336ae2/ext/intl/idn/idn.c#L175 Seems like triggering false is only possible (for us) by an empty domain/host name, which is already catched by isset($parsedUrl['host']) or with a string length larger than INT32_MAX, which will lead to memory exhaustion. So imo this is fine without a test case.
  9. Christian Kuhn voted on patch set 2 V +1 CR +1 12/20/21, 20:18

  10. Stefan Bürk voted on patch set 2 V +1 CR +1 12/20/21, 20:28

  11. Oli Bartsch voted on patch set 2 V +2 CR +2 12/20/21, 22:04

  12. Oli Bartsch merged patch set 3 12/20/21, 22:04