Skip to content

Commit 47ad5ff

Browse files
authoredMar 7, 2024
Merge branch 'master' into fastimage-log
2 parents bf085ce + 86198aa commit 47ad5ff

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed
 

Diff for: ‎app/Http/Controllers/RankingController.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -259,18 +259,16 @@ public function kudosu()
259259
)];
260260
}
261261

262-
$scores->loadMissing('country');
263-
264262
return ext_view('rankings.kudosu', compact('scores'));
265263
}
266264

267265
public function spotlight($mode)
268266
{
269-
$chartId = $this->params['spotlight'] ?? null;
267+
$chartId = get_int($this->params['spotlight'] ?? null);
270268

271269
$spotlights = Spotlight::orderBy('chart_id', 'desc')->get();
272270
if ($chartId === null) {
273-
$spotlight = $spotlights->first();
271+
$spotlight = $spotlights->first() ?? abort(404);
274272
} else {
275273
$spotlight = Spotlight::findOrFail($chartId);
276274
}

Diff for: ‎app/Http/Controllers/UsersController.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -1003,12 +1003,13 @@ private function storeUser(array $rawParams)
10031003

10041004
$user = $registration->user();
10051005

1006-
if ($country === null) {
1006+
// report unknown country code but ignore non-country from cloudflare
1007+
if ($countryCode !== null && $country === null && $countryCode !== 'T1') {
10071008
app('sentry')->getClient()->captureMessage(
1008-
'User registered from unknown country: '.$countryCode,
1009+
'User registered from unknown country',
10091010
null,
10101011
(new Scope())
1011-
->setExtra('country', $countryCode)
1012+
->setTag('country', $countryCode)
10121013
->setExtra('ip', $ip)
10131014
->setExtra('user_id', $user->getKey())
10141015
);

Diff for: ‎app/helpers.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1133,11 +1133,11 @@ function nav_links()
11331133
];
11341134
$links['rankings'] = [
11351135
'rankings.type.performance' => route('rankings', ['mode' => $defaultMode, 'type' => 'performance']),
1136-
'rankings.type.charts' => route('rankings', ['mode' => $defaultMode, 'type' => 'charts']),
11371136
'rankings.type.score' => route('rankings', ['mode' => $defaultMode, 'type' => 'score']),
11381137
'rankings.type.country' => route('rankings', ['mode' => $defaultMode, 'type' => 'country']),
11391138
'rankings.type.multiplayer' => route('multiplayer.rooms.show', ['room' => 'latest']),
11401139
'rankings.type.seasons' => route('seasons.show', ['season' => 'latest']),
1140+
'rankings.type.charts' => route('rankings', ['mode' => $defaultMode, 'type' => 'charts']),
11411141
'layout.menu.rankings.kudosu' => route('rankings.kudosu'),
11421142
];
11431143
$links['community'] = [

Diff for: ‎resources/lang/en/rankings.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
],
2525

2626
'type' => [
27-
'charts' => 'spotlights',
27+
'charts' => 'spotlights (old)',
2828
'country' => 'country',
2929
'kudosu' => 'kudosu',
3030
'multiplayer' => 'multiplayer',

Diff for: ‎resources/views/rankings/index.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
];
2525
2626
$links = [];
27-
foreach (['performance', 'charts', 'score', 'country', 'multiplayer', 'seasons', 'kudosu'] as $tab) {
27+
foreach (['performance', 'score', 'country', 'multiplayer', 'seasons', 'charts', 'kudosu'] as $tab) {
2828
$links[] = [
2929
'active' => $tab === $type,
3030
'title' => osu_trans("rankings.type.{$tab}"),

Diff for: ‎resources/views/rankings/kudosu.blade.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
<td class="ranking-page-table__column">
3939
<div class="ranking-page-table__user-link">
4040
@include('objects._flag_country', [
41-
'countryCode' => $user->country->acronym,
41+
'countryCode' => $user->country_acronym,
4242
'modifiers' => 'medium',
4343
])
44-
{!! link_to_user($user, null, '', ['ranking-page-table__user-link-text']) !!}
44+
{!! link_to_user($user, null, '', ['ranking-page-table__user-link-text']) !!}
4545
</div>
4646
</td>
4747
<td class="ranking-page-table__column ranking-page-table__column--focused">

0 commit comments

Comments
 (0)