The extraneous whitespace in the return value from wfShellExec() causes
multiplying $size to trigger the newly introduced "A non well formed
numeric value encountered" warning in PHP 7.1+.
Work around that by using trim() to get rid of the whitespace.
Bug: T186299
Change-Id: I3d47ef6cc7fb99b4d4840dc847d150c3939ee535
The two lualib/ustring generation scripts run independently of MediaWiki, so
the new wfIsCLI() isn't usable there.
Bug: T184043
Change-Id: I217657d12e16a7b76dc814be5fed03540c461e7c