🐛 Filter XSS injection (#31)

This commit is contained in:
Jade
2021-06-01 12:34:24 +08:00
committed by GitHub
parent f16b266155
commit f7bb5969cf
3 changed files with 9 additions and 0 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
/vendor/
.env
.idea/

View File

@@ -38,6 +38,10 @@ try {
$storagePath = $_ENV['FILE_STORAGE_PATH'];
}
array_walk_recursive($_GET, function (&$input) {
$input = htmlspecialchars($input, ENT_NOQUOTES, 'UTF-8', false);
});
$badgeLabel = $_GET['label'] ?? 'Profile views';
$badgeMessageBackgroundFill = $_GET['color'] ?? 'blue';
$badgeStyle = $_GET['style'] ?? 'flat';

View File

@@ -42,6 +42,10 @@ try {
$httpUserAgent = $_SERVER['HTTP_USER_AGENT'] ?? '';
array_walk_recursive($_GET, function (&$input) {
$input = htmlspecialchars($input, ENT_NOQUOTES, 'UTF-8', false);
});
$badgeLabel = $_GET['label'] ?? 'Profile views';
$badgeMessageBackgroundFill = $_GET['color'] ?? 'blue';
$badgeStyle = $_GET['style'] ?? 'flat';