Page MenuHomePhabricator

ShellBox test failure for php8.1 with html entity escaping (' vs. ')
Closed, ResolvedPublic

Description

https://integration.wikimedia.org/ci/job/composer-package-php81-docker/41/console

22:42:28 1) Wikimedia\Shellbox\Tests\ShellParser\PEGParserTest::testParse with data set #6 (''a'\''a'', '<program><complete_command><s...ogram>')
22:42:28 Failed asserting that two strings are identical.
22:42:28 --- Expected
22:42:28 +++ Actual
22:42:28 @@ @@
22:42:28 -'<program><complete_command><simple_command><word><single_quote>a</single_quote><bare_escape>'</bare_escape><single_quote>a</single_quote></word></simple_command></complete_command></program>'
22:42:28 +'<program><complete_command><simple_command><word><single_quote>a</single_quote><bare_escape>&#039;</bare_escape><single_quote>a</single_quote></word></simple_command></complete_command></program>'

According to https://www.php.net/manual/en/function.htmlspecialchars.php the default flags for htmlspecialchars are changed in php8.1 and possible the issue for this different (escaping vs. no escaping)

Event Timeline

Change 789216 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/libs/Shellbox@master] Compatibility with php8.1: Use ENT_COMPAT on htmlspecialchars

https://gerrit.wikimedia.org/r/789216

Change 789216 merged by jenkins-bot:

[mediawiki/libs/Shellbox@master] Compatibility with php8.1: Use ENT_COMPAT on htmlspecialchars

https://gerrit.wikimedia.org/r/789216

Change 808438 had a related patch set uploaded (by Reedy; author: Umherirrender):

[mediawiki/libs/Shellbox@2.x] Compatibility with php8.1: Use ENT_COMPAT on htmlspecialchars

https://gerrit.wikimedia.org/r/808438

Change 808438 merged by Reedy:

[mediawiki/libs/Shellbox@2.x] Compatibility with php8.1: Use ENT_COMPAT on htmlspecialchars

https://gerrit.wikimedia.org/r/808438