Skip to content

Commit

Permalink
Specify language in scraper so it doesn't look for the wrong thing
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsrec authored Nov 13, 2023
1 parent 77a7cb5 commit 7243a61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/verification/ScratchUserCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 7243a61

Please sign in to comment.