Skip to content

Conversation

McModknower
Copy link
Contributor

In the case that a message ends with a ", json_encode encodes it to a \", and trim removes that quotation mark since after it there is only one quotation mark more.

Messages that end like that are then stored in the database and since the encoded message is invalid json, users see empty messages.

To fix this i propose changing the trim() call to calling substr and removing explicitly just the first and last character.

@GaneshKandu GaneshKandu merged commit b0793c4 into php-kchat:master Feb 24, 2022
GaneshKandu added a commit that referenced this pull request Feb 24, 2022
…encoding.

Don't strip quotation marks at the end of normal chat messages after encoding.
#13
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