-
Bug
-
Resolution: Fixed
-
Minor
-
4.3.4, 4.4, 4.5
If you send an update which contains a % it breaks an sprintf call, 1 liner to escape it.
Attached is an example script showing the failure. Normal tty mode works fine:
root@14acf95cfe6f:/var/www/master# php MDL-81901-escape-progress.php
|
[███████████████████████████████████████████████████████] 100.0%
|
a good test
|
[███████████████████████████████████████████████████████] 100.0%
|
a bad %3d test
|
But when you pipe it through cat or similar it converts to non tty mode and you get this bug:
root@14acf95cfe6f:/var/www/master# php MDL-81901-escape-progress.php | cat
|
[#######################################################] 100.0%
|
a good test
|
[#####################################################!!! Exception - 3 arguments are required, 2 given !!!
|
!!
|
Error code: generalexceptionmessage !!
|
!! Stack trace: * line 5496 of /lib/outputrenderers.php: ArgumentCountError thrown
|
* line 5496 of /lib/outputrenderers.php: call to sprintf()
|
* line 5299 of /lib/outputcomponents.php: call to core_renderer_cli->render_progress_bar_update()
|
* line 5336 of /lib/outputcomponents.php: call to progress_bar->_update()
|
* line 28 of /MDL-81901-escape-progress.php: call to progress_bar->update_full()
|
!!
|