If there is a reason to sanitize your users βinput (security, size, speed, accuracy ...), do it.
But do not do it otherwise.
In fact, you get many times when you accept your data for data entry as is. They have their own typos or spelling errors, broken links, etc. Thus. So far this does not create a problem for you (i.e. you have no reason to disinfect it).
BTW - the sequence is controversial, because it will not change the data type, and you can easily check for "HTTP: //" and add or remove a useful function in your presentation layers with RESET if necessary.
source share