Today I met the following issue/problem.
Database data (MySQL) appeared beginning with characters ​
(ZERO WIDTH SPACE). The data was saved by some user via the html form filled in by the copy-paste method from the email with html body content. These inconsistencies in the data subsequently caused errors in future processes.
So, is there any general solution that prevents storing html entities (such as ​
) entered to the form using the copy-paste method?
Is it better to solve this problem on server side (PHP) or on client side (JavaScript)?