-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getOutput() does not trim the form feed character #61
Comments
What if these characters are part of some expected output? We should not just trim withouth warning. We could have an option (default off), though. But I wonder if it's really our library that should take care of this. Did you maybe investigate what causes this extra character? Does it happen in both cases, with |
Sorry, I should have looked at your code more closely. I forgot that we already trim by default. So maybe it's really safe to add these extra characters. I'll have a look. |
@daveherman71 I've created a PR. Could you have a look and maybe also test if it works for you? I don't use Windows. |
Thanks, that version works. Please note that this module was installed as a dependency of |
Issue #61 Add form feed to trimmed characters
Hmm, ok, but with phpwkhtmltopdf there should be no problem with missing trim characters? So I assume you also use the library for other shell commands. Anyway, I've just released 1.7.0 containing this fix. Thanks for your help. |
In the Windows environment it appears that the stdOut is preceded by
\x0C
(ASCII Form Feed character).This is a problem when the expected stdOut is a JSON response string which will not parse using json_decode() because of the "invisible" form feed character.
The PHP trim() function does not strip these characters by default so the suggested change would be to replace the getOutput() function as follows
And perhaps extend this change to getError() and getStdErr() as well.
The text was updated successfully, but these errors were encountered: