Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow html in text messages, for creating for instance links #1

Merged
merged 4 commits into from
May 17, 2016

Conversation

carlosrgzm
Copy link

Remove htmlentites from the message to allow links in the notification's messages

Remove htmlentites from the message to allow links in the notification's messages
@carlosrgzm carlosrgzm closed this Mar 19, 2016
@carlosrgzm carlosrgzm reopened this Mar 19, 2016
Changed package name to allow upload it to packagist
@oriceon oriceon merged commit 96efed4 into oriceon:master May 17, 2016
@stevevg
Copy link

stevevg commented Jun 16, 2016

This causes errors when the notification message actually contains single quote character (i.e. passing a string cotaining the word "D'Anna" - without double quotes - throws an error).

@thunder87
Copy link

thunder87 commented Jun 16, 2016

stefanopallicca
Just escape that character, i'm guessing that you are getting the parameter from a string.
Toastr::success("Welcome ".htmlspecialchars($user->firstname, ENT_QUOTES));

@stevevg
Copy link

stevevg commented Jun 20, 2016

That's a good point.
I suggest to review the documentation, adding a warning to escape characters in case of a string that may contain the single quote char.
However, IMHO a method to automatically tell if a string contains HTML or not, would be preferrable.
Alternatively, a new parameter could be added to the info|error|success|warning functions, indicating if the string should be escaped or not.
I may work on this if you think could be useful....

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.

4 participants