[BUGFIX] Handle excess whitespace characters in `CommandUtility::exec()`
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 Resolves: #105251 Related: #104045 Releases: main Change-Id: I726b6ac0214f2cb3983db7b66c366a1fa58f93f8 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/86533 Reviewed-by:Benjamin Kott <benjamin.kott@outlook.com> Tested-by:
Benjamin Kott <benjamin.kott@outlook.com> Tested-by:
Benjamin Franzke <ben@bnf.dev> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Andreas Kienast <akienast@scripting-base.de> Tested-by:
Andreas Kienast <akienast@scripting-base.de> Reviewed-by:
Benjamin Franzke <ben@bnf.dev>
Please register or sign in to comment