Skip to content

Conversation

GaryHaddon
Copy link

…rsion error if data is an array.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants