什么是\x1a
字符的含义以及为什么mysql_real_escape_string
逃避吗?
从文档中:
mysql_real_escape_string() 调用 MySQL 的库函数 mysql_real_escape_string,该函数在以下字符前面添加反斜杠:\x00、\n、\r、\、'、" 和 \x1a。
ASCII 字符参考将其描述为Substitute character
,但这并没有说明太多。
这是一个统一码转义序列,十六进制(基数 16) https://php.net/manual/en/regexp.reference.escape.php. \x1a
is the “替补”字 https://www.fileformat.info/info/unicode/char/1a/index.htm.
也可以看看:https://en.wikipedia.org/wiki/Substitute_character https://en.wikipedia.org/wiki/Substitute_character
为什么mysql_real_escape_string
逃避吗?
根据文档, https://dev.mysql.com/doc/c-api/8.0/en/mysql-real-escape-string.html
严格来说,MySQL 只要求对查询中的反斜杠和用于引用字符串的引号字符进行转义。mysql_real_escape_string()
引用其他字符以使它们更容易在日志文件中阅读。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)