mirror of
https://github.com/antonkomarev/github-profile-views-counter.git
synced 2026-07-22 05:32:28 -04:00
🐛 Filter XSS injection (#31)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
/vendor/
|
||||
.env
|
||||
.idea/
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user