From 7243a61e444346919c41f01a52c8349d5c464089 Mon Sep 17 00:00:00 2001 From: mrsrec <6236968+mrsrec@users.noreply.github.com> Date: Mon, 13 Nov 2023 15:33:19 -0800 Subject: [PATCH] Specify language in scraper so it doesn't look for the wrong thing --- src/verification/ScratchUserCheck.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/verification/ScratchUserCheck.php b/src/verification/ScratchUserCheck.php index d6bda3d..f402f26 100644 --- a/src/verification/ScratchUserCheck.php +++ b/src/verification/ScratchUserCheck.php @@ -8,7 +8,9 @@ class ScratchUserCheck { private static function fetchProfile($username, &$isScratcher, &$joinedAt, &$error) { $url = sprintf(self::PROFILE_URL, $username); - $html = @file_get_contents($url); + $html = @file_get_contents($url, false, stream_context_create( + "http" => ["header" => "Accept-Language: en\r\nCookie: scratchlanguage=en"] + )); if ($html === false) { $isScratcher = null; // can't tell Scratcher status $error = 'scratch-confirmaccount-profile-error';