Skip to content

Commit

Permalink
Merge pull request #11794 from nanaya/background-image-proxy
Browse files Browse the repository at this point in the history
Remove proxying option of blade background image
  • Loading branch information
notbakaneko authored Jan 20, 2025
2 parents 832081c + 4a0a233 commit f6be1f0
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 14 deletions.
12 changes: 4 additions & 8 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,11 @@ function atom_id(string $namespace, $id = null): string
return 'tag:'.request()->getHttpHost().',2019:'.$namespace.($id === null ? '' : "/{$id}");
}

function background_image($url, $proxy = true)
function background_image($url): string
{
if (!present($url)) {
return '';
}

$url = $proxy ? proxy_media($url) : $url;

return sprintf(' style="background-image:url(\'%s\');" ', e($url));
return present($url)
? sprintf(' style="background-image:url(\'%s\');" ', e($url))
: '';
}

function beatmap_timestamp_format($ms)
Expand Down
2 changes: 1 addition & 1 deletion resources/views/follows/modding.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<td class="beatmapset-watches__col beatmapset-watches__col--cover">
<a href="{{ route('beatmapsets.discussion', $watch->beatmapset) }}">
<div
{!! background_image($watch->beatmapset->coverURL('list'), false) !!}
{!! background_image($watch->beatmapset->coverURL('list')) !!}
class="beatmapset-watches__cover"
></div>
</a>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/forum/topics/_post_info.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class="forum-post-info__row forum-post-info__row--title"
<a
class="flag-team"
href="{{ route('teams.show', $team) }}"
{!! background_image($team->logo()->url(), false) !!}
{!! background_image($team->logo()->url()) !!}
>
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layout/_header_user.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ class="{{ $class }} avatar--guest"
class="{{ $class }} {{ Auth::user()->isRestricted() ? 'avatar--restricted' : '' }}"
data-click-menu-target="nav2-user-popup"
href="{{ route('users.show', Auth::user()) }}"
{!! background_image(Auth::user()->user_avatar, false) !!}
{!! background_image(Auth::user()->user_avatar) !!}
></a>
@endif
2 changes: 1 addition & 1 deletion resources/views/layout/_page_header_v4.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
">
<div class="header-v4__container header-v4__container--main">
<div class="header-v4__bg-container">
<div class="header-v4__bg {{ $backgroundExtraClass }}" {!! background_image($backgroundImage ?? null, false) !!}></div>
<div class="header-v4__bg {{ $backgroundExtraClass }}" {!! background_image($backgroundImage ?? null) !!}></div>
</div>

<div class="hidden-xs js-sync-height--target" data-sync-height-id="notification-banners">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layout/_popup_user.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class="simple-menu simple-menu--nav2 js-click-menu js-nav2--centered-popup"
<a
href="{{ $currentUserUrl }}"
class="simple-menu__header simple-menu__header--link js-current-user-cover"
{!! background_image($currentUser->cover()->url(), false) !!}
{!! background_image($currentUser->cover()->url()) !!}
>
<img class="simple-menu__header-icon" src="/images/icons/profile.svg" alt="">
<div class="u-relative">{{ $currentUser->username }}</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/objects/_flag_team.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<span
class="{{ class_with_modifiers('flag-team', $modifiers ?? null) }}"
title="{{ $team->name }}"
{!! background_image($team->logo()->url(), false) !!}
{!! background_image($team->logo()->url()) !!}
></span>

0 comments on commit f6be1f0

Please sign in to comment.