Skip to content

Commit 68fc41c

Browse files
committed
do not trim strings containing binary data
1 parent 309f169 commit 68fc41c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/SapRfcFunction.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ public function __destruct()
5151
/**
5252
* Execute the prepared function call.
5353
* @return array
54-
* @throws \phpsap\exceptions\ConnectionFailedException
5554
* @throws \phpsap\exceptions\FunctionCallException
56-
* @throws \phpsap\exceptions\UnknownFunctionException
5755
*/
5856
protected function execute()
5957
{
@@ -113,11 +111,9 @@ protected function trimStrings($return)
113111
protected function rTrim($string)
114112
{
115113
/**
116-
* Do not trim strings containing line breaks.
114+
* Do not trim strings containing non-printable characters.
117115
*/
118-
if (strpos($string, "\n") !== false
119-
|| strpos($string, "\r\n") !== false
120-
) {
116+
if (!ctype_print($string)) {
121117
return $string;
122118
}
123119
return rtrim($string);

0 commit comments

Comments
 (0)