Showing entries 1 to 1
Displaying posts with tag: cleanup data (reset)
MySql: cleaning user input before storing the data

This article describes a single MySql function to sanitize strings. The provided options are:

  • replace multiple spaces to a single space
  • remove Unix and Windows linebreaks and replace them with a space
  • remove tabs and replace them for a single space
  • remove multiple backslashes
  • completely remove htmlentities (&)
  • replace htmlentities with the corresponding character
  • remove all HTML tags
Showing entries 1 to 1