osTicket/osTicket-1.7 — pull request #166 by greezybacon (2012-07-23 03:16:13+00:00)
Title: Property handle Unicode and HTML entities

I'm not sure I really like this change, but let's start the discussion. This code properly converts **all** HTML entities to their UTF-8 encoded counterparts. This should be storable in the database without any trouble. When data is displayed, all the UTF-8 characters that have an HTML entity counterpart are converted (as opposed to just the basic ones).

This will *hopefully* fix entities like ` `, which could potentially not have been converted properly -- for PHP < 5.4.0, it would be converted to ASCII char 160, which could be interpreted a number of different ways including breaking database statements. Furthermore, it should correctly reproduce the ` ` when the content is to be sent back to the client again. Lastly, it should hopefully be future-proof and support other entities such as `—` and so on.

For PHP >= 5.4.0, this code will only have the effect of switching to the `htmlentities` function. `UTF-8` is the default encoding scheme for PHP >= 5.4.0. From that perspective, this code will help make osTicket more consistent with future versions of PHP