Thanks to visit codestin.com
Credit goes to github.com

Skip to content

5.2.6 breaks progress bar when unicode characters are in messageΒ #40633

Closed
@grasmash

Description

@grasmash

Symfony version(s) affected: 5.2.6

Description
5.2.6 included these changes to strlenWithoutDecoration() which break the progress bar when a unicode character is used as the progress bar character.

$progress->setProgressCharacter('πŸ’§');

How to reproduce
This test case reproduces the issue: https://github.com/acquia/cli/blob/master/tests/phpunit/src/Commands/Pull/PullDatabaseCommandTest.php#L294

The progress bar length is incorrectly calculated and results in an error:

str_repeat(): Second argument has to be greater than or equal to 0
/home/travis/build/acquia/cli/vendor/symfony/console/Helper/ProgressBar.php:517
/home/travis/build/acquia/cli/vendor/symfony/console/Helper/ProgressBar.php:576
/home/travis/build/acquia/cli/vendor/symfony/console/Helper/ProgressBar.php:589
/home/travis/build/acquia/cli/vendor/symfony/console/Helper/ProgressBar.php:414
/home/travis/build/acquia/cli/vendor/symfony/console/Helper/ProgressBar.php:323
/home/travis/build/acquia/cli/src/Output/Spinner/Spinner.php:151
/home/travis/build/acquia/cli/src/Output/Checklist.php:42
/home/travis/build/acquia/cli/tests/phpunit/src/Commands/ChecklistTest.php:28

Possible Solution

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions