• @solrize
    link
    English
    581 day ago

    /me changes name to '); DROP TABLE STUDENTS; --.

    • @ZILtoid1991
      link
      English
      219 hours ago

      Are there character escapes for SQL, to protect against stuff like that?

      • @[email protected]
        link
        fedilink
        English
        12 hours ago

        Only noobs get hit by this (called SQL injection). That’s why we have leads review code…

      • @solrize
        link
        English
        918 hours ago

        Yes but it’s a dangerous process. You should use paramatrized queries instead.

        • @[email protected]
          link
          fedilink
          English
          1
          edit-2
          2 hours ago

          Yup, then it becomes a front-end problem to deal with wonky input. As a backend dev, this is ideal, just give me data and I’ll store it for ya.

      • @[email protected]
        link
        fedilink
        English
        2
        edit-2
        15 hours ago

        Input sanitization typically handles this as a string that only allows characters supported by the data type specified by the table field in question. A permissive strategy might scrub the string of unexpected characters. A strict one might throw an error. The point, however, is to prevent the evaluation of inputs as anything other than their intended type, whether or not reserved characters are present.