Merge pull request #4919 from yafbot/escape-url

This commit is contained in:
HDVinnie
2025-08-28 16:51:21 -04:00
committed by GitHub
4 changed files with 13 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ limewire
mal
mediainfo
phpstorm
rottentomatoes
shareaza
tmdb
tvdb

View File

@@ -56,6 +56,16 @@ if (!\function_exists('href_request')) {
}
}
if (!\function_exists('href_rottentomatoes')) {
function href_rottentomatoes(string|null $title, string|null $date): string
{
$year = substr($date ?? '', 0, 4);
$query = "{$title} ({$year}) site:rottentomatoes.com";
return "https://html.duckduckgo.com/html/?q=\\".rawurlencode($query);
}
}
if (!\function_exists('href_poll')) {
function href_poll(App\Models\Poll $poll): string
{

View File

@@ -197,8 +197,7 @@
<li class="meta__rotten">
<a
class="meta-id-tag"
{{-- cspell:disable-next-line --}}
href="https://html.duckduckgo.com/html/?q=\{{ $meta->title ?? '' }} ({{ substr($meta->release_date ?? '', 0, 4) ?? '' }})+site%3Arottentomatoes.com"
href="{{ href_rottentomatoes($meta->name, $meta->release_date) }}"
title="Rotten Tomatoes: {{ $meta->title ?? '' }} ({{ substr($meta->release_date ?? '', 0, 4) ?? '' }})"
target="_blank"
rel="noreferrer"

View File

@@ -196,8 +196,7 @@
<li class="meta__rotten">
<a
class="meta-id-tag"
{{-- cspell:disable-next-line --}}
href="https://html.duckduckgo.com/html/?q=\{{ $meta->name ?? '' }} ({{ substr($meta->first_air_date ?? '', 0, 4) ?? '' }})+site%3Arottentomatoes.com"
href="{{ href_rottentomatoes($meta->name, $meta->first_air_date) }}"
title="Rotten Tomatoes: {{ $meta->name ?? '' }} ({{ substr($meta->first_air_date ?? '', 0, 4) ?? '' }})"
target="_blank"
rel="noreferrer"