Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我使用 $_GET 从 URL 字符串中检索数据并且没有在网页上显示该数据或对其执行任何 SQL 操作,我是否仍应考虑使用转义、正则表达式和其他安全代码?该字符串可以包含任何字符。
希望这是有道理的。
如果您不输出字符串或将其传递给另一个程序(sql、打开文件等),则不需要转义它。
如果您没有在 SQL 语句中使用 URL 参数,则它不能用作 SQL 注入。