Skip to content

Commit

Permalink
update to check lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsrec authored Aug 8, 2024
1 parent a30f6b4 commit 094e6df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/SpecialRequestAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function accountRequestFormData(&$out_error, IDatabase $dbr) {
}

//make sure the user actually commented the verification code
if (ScratchVerification::topVerifCommenter(ScratchVerification::sessionVerificationCode($session)) !== $username) {
if (strtolower(ScratchVerification::topVerifCommenter(ScratchVerification::sessionVerificationCode($session))) !== strtolower($username)) {
$out_error = wfMessage('scratch-confirmaccount-verif-missing', $username)->parse();
return;
}
Expand Down
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 094e6df

Please sign in to comment.