Review main Merged

86533[BUGFIX] Handle excess whitespace characters in `CommandUtility::exec()`

Andreas Kienast CR +2 V +2 Easy +8 −2 updated 10/09/24, 10:58

Commit message

PHP's behavior of `exec()` [1] is flabbergasting: when writing the
buffer, trailing whitespace characters are trimmed as follows:

1. the last PHP_EOL character is chopped
2. any left-over trailing literal space characters are trimmed

Neither of this was handled in the implementation introduced
in #104045, leading to unexpected output.

This commit emulates the behavior of PHP's internal `exec()` function,
restoring the previous behavior of `CommandUtility::exec()`.

[1] https://github.com/php/php-src/blob/master/ext/standard/exec.c

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Benjamin Franzke +1
    • Benjamin Kott +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Benjamin Franzke +1
    • Benjamin Kott +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 68

  1. Andreas Kienast uploaded patch set 1 10/09/24, 10:39

  2. Benjamin Franzke voted on patch set 1 CR +1 10/09/24, 10:40

  3. Benjamin Kott voted on patch set 1 CR +1 V +1 10/09/24, 10:43

  4. Benjamin Franzke voted on patch set 1 V +1 10/09/24, 10:46

  5. core-ci voted on patch set 1 V -1 10/09/24, 10:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67438

  6. core-ci voted on patch set 1 V +1 10/09/24, 10:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67438

  7. Andreas Kienast voted on patch set 1 CR +2 V +2 10/09/24, 10:58

  8. Andreas Kienast merged patch set 2 10/09/24, 10:58