我正在尝试使用sanitize function来保持代码的简单性。因为我使用的是MYSQLi,所以我想知道下面的代码是否正确?
function sanitize ($data){
global $db_connect;
return htmlentities(strip_tags($db_connect->real_escape_string($data)));
}
function array_sanitize ($item) {
global $db_connect;
$item = htmlentities(strip_tags($db_con
以下内容如下:
我不太明白这里的意图(我的代码使用上述参考教程的一部分):
// XSS protection to avoid printing the value
/* Developer's Note: Not actually sure what the purpose of this is, or how it protects. */
$id = preg_replace("/[^a-zA-Z0-9_\-]+/", "", $id);
$uname = preg_replace("/[^a-zA-Z0-9_\-]+/",
我有这样的和弦
Bb
This is amazing grace
Eb
This is unfailing love
Gm
That You would take my place
F
That You would bear my cross
我用regex来匹配和弦,并用强标记替换和弦。
const boldLyrics = lyrics?.replace(
/(\b([CDEFGAB](?:b|bb)*(?:#|##|sus|maj|min|m|aug)*[\d\/]*(?:[CDEFGAB](?:b|bb)*(?:#|##|sus|maj|min|m|au