Skip to content

getOutput() does not trim the form feed character #61

Closed
@daveherman71

Description

@daveherman71

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

    public function getOutput($trim = true)
    {
        return $trim ? trim($this->_stdOut, " \t\n\r\0\x0B\x0C") : $this->_stdOut;
    }

And perhaps extend this change to getError() and getStdErr() as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions