code-injectionsanitizationunidatau2uniquery

Sanitize Input for UniData


Can anyone provide a function to sanitize input for a UniData query? Or provide a list of things to remove?


Solution

  • Here's a list of characters reserved by UniQuery:

     " double quote
     ' apostrophe (single quote)
     / forward slash
     [ left square bracket
     \ back slash
     ] right square bracket
     ^ caret
    

    You can write a quick function that takes a string, does a SWAP for each of these characters--you can swap with the ISO 8859-1 decimal code (e.g., ] for ])--and returns the sanatized string.