Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Model/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,14 @@ public function escapeJsQuote($data, $quote = '\'')

/**
* @param $data
* @return string
* @return array|string|null
*/
public function escapeReturn($data)
{
return trim(str_replace(["\r\n", "\r", "\n"], ' ', $data));
if (!is_null($data) && !is_array($data)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GaryHaddon ... why not

return is_string($data) ? trim(str_replace(["\r\n", "\r", "\n"], ' ', $data)) : $data;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srenon either works.

return trim(str_replace(["\r\n", "\r", "\n"], ' ', $data));
}
return $data;
}

/**
Expand Down