Skip to content

Commit

Permalink
do not trim strings containing binary data
Browse files Browse the repository at this point in the history
  • Loading branch information
gregor-j committed Jan 24, 2019
1 parent 309f169 commit 68fc41c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/SapRfcFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ public function __destruct()
/**
* Execute the prepared function call.
* @return array
* @throws \phpsap\exceptions\ConnectionFailedException
* @throws \phpsap\exceptions\FunctionCallException
* @throws \phpsap\exceptions\UnknownFunctionException
*/
protected function execute()
{
Expand Down Expand Up @@ -113,11 +111,9 @@ protected function trimStrings($return)
protected function rTrim($string)
{
/**
* Do not trim strings containing line breaks.
* Do not trim strings containing non-printable characters.
*/
if (strpos($string, "\n") !== false
|| strpos($string, "\r\n") !== false
) {
if (!ctype_print($string)) {
return $string;
}
return rtrim($string);
Expand Down

0 comments on commit 68fc41c

Please sign in to comment.