MWDelaney / bootstrap-3-shortcodes

WordPress shortcodes for easier use of Bootstrap elements in your content.
https://wordpress.org/plugins/bootstrap-3-shortcodes/
MIT License
377 stars 118 forks source link

Popover Special Characters Fix. #102

Closed billyromano closed 9 years ago

billyromano commented 9 years ago

Fixed an issue where using special characters in a popover would prevent the popover displaying text, for example: using a comma (,) would remove the rest of the text including and after the comma (,). The issue is caused by using the DOMDocument approach to writing valid XML and wouldn't be a problem if a string literal approach was used instead. (http://php.net/manual/en/domdocument.save.php - Special Characters)

MWDelaney commented 9 years ago

Happy to merge, but first, would it make sense to utf8_encode the returned value for every instance of get_dom_element?

billyromano commented 9 years ago

Yes, that makes sense. However, I further tested my code again and noticed the comma (,) was still breaking the preview lol. I’m not sure how that worked and now it doesn’t, but we at least need to figure out how to get valid output of a comma (,) inside the attribute. Sorry about that, such a n00b mistake, but at least the utf8_encode method is correct for special characters beyond the comma. Any idea what might fix this? probably put <![CDATA[]]> tags in if HTML = true?

On Feb 10, 2015, at 2:19 PM, MWDelaney notifications@github.com wrote:

Happy to merge, but first, would it make sense to utf8_encode the returned value for every instance of get_dom_element?

— Reply to this email directly or view it on GitHub.

MWDelaney commented 9 years ago

Hi! 92b8b7cf8b2bbcef37d00dfa4b65f50f056e1f87 should resolve this issue at least for [popover]. Can you give it a try?