Skip to content

Commit

Permalink
fix: escape contents for SEO library (#1411)
Browse files Browse the repository at this point in the history
  • Loading branch information
iBotPeaches authored Aug 1, 2024
1 parent 0231eb4 commit 28b5fcb
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/GameController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public function index(Game $game): View
{
$images[] = $game->map->thumbnail_url;

SEOTools::setTitle($game->name);
SEOTools::setTitle(e($game->name));
SEOTools::addImages($images);
SEOTools::setDescription($game->description);
SEOTools::setDescription(e($game->description));

return view('pages.game', [
'game' => $game,
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/HcsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public function index(): View

public function championship(Championship $championship, string $bracket = Bracket::WINNERS, int $round = 1): View
{
SEOTools::setTitle($championship->name);
SEOTools::setDescription($championship->name.' ('.$championship->region.')');
SEOTools::setTitle(e($championship->name));
SEOTools::setDescription(e($championship->name.' ('.$championship->region.')'));

return view('pages.championship', [
'championship' => $championship,
Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/LeaderboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public function topTenList(): View

public function medal(Medal $medal): View
{
SEOTools::setTitle($medal->name.' Leaderboards');
SEOTools::setTitle(e($medal->name.' Leaderboards'));
SEOTools::addImages([
$medal->image,
]);
SEOTools::setDescription('Halo Infinite Medal: '.$medal->name.' Leaderboards');
SEOTools::setDescription(e('Halo Infinite Medal: '.$medal->name.' Leaderboards'));

/** @var ScheduleTimer $timer */
$timer = resolve(ScheduleTimerInterface::class);
Expand All @@ -45,8 +45,8 @@ public function topTen(AnalyticKey $key): View
{
$analyticClass = Analytic::getStatFromEnum($key);

SEOTools::setTitle($analyticClass->title().' Top Ten Leaderboards');
SEOTools::setDescription('Top Ten Halo Infinite Leaderboards: '.$analyticClass->title());
SEOTools::setTitle(e($analyticClass->title().' Top Ten Leaderboards'));
SEOTools::setDescription(e('Top Ten Halo Infinite Leaderboards: '.$analyticClass->title()));

return view('pages.topten-leaderboard', [
'analyticClass' => $analyticClass,
Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/OverviewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class OverviewController extends Controller
{
public function list(string $filterType = OverviewType::MATCHMAKING): View
{
SEOTools::setTitle('Map Overviews');
SEOTools::setDescription('Halo Infinite - Leaf Map Overviews');
SEOTools::setTitle(e('Map Overviews'));
SEOTools::setDescription(e('Halo Infinite - Leaf Map Overviews'));

return view('pages.overviews', [
'type' => $filterType,
Expand All @@ -24,11 +24,11 @@ public function list(string $filterType = OverviewType::MATCHMAKING): View

public function show(Overview $overview, string $tab = OverviewTab::OVERVIEW): View
{
SEOTools::setTitle('Map Overview: '.$overview->name);
SEOTools::setTitle(e('Map Overview: '.$overview->name));
SEOTools::addImages([
$overview->image,
]);
SEOTools::setDescription('Halo Infinite - Leaf Map Overview: '.$overview->name);
SEOTools::setDescription(e('Halo Infinite - Leaf Map Overview: '.$overview->name));

return view('pages.overview', [
'overview' => $overview,
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/PlayerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ class PlayerController extends Controller
{
public function index(Request $request, Player $player, string $type = PlayerTab::OVERVIEW): View
{
SEOTools::setTitle($player->gamertag.' '.Str::title($type));
SEOTools::setTitle(e($player->gamertag.' '.Str::title($type)));
SEOTools::addImages([
$player->emblem_url,
]);
SEOTools::setDescription($player->gamertag.' Halo Infinite '.Str::title($type));
SEOTools::setDescription(e($player->gamertag.' Halo Infinite '.Str::title($type)));

return view('pages.player', [
'player' => $player,
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/PlaylistController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public function index(Request $request, ?Playlist $playlist = null): View
abort(Response::HTTP_NOT_FOUND);
}

SEOTools::setTitle($playlist->name);
SEOTools::setDescription($playlist->title);
SEOTools::setTitle(e($playlist->name));
SEOTools::setDescription(e($playlist->title));

$playlists = Playlist::query()
->where('is_active', true)
Expand Down

0 comments on commit 28b5fcb

Please sign in to comment.