diff --git a/themes/danbooru/view.theme.php b/themes/danbooru/view.theme.php index eed15aea..96fd7da5 100644 --- a/themes/danbooru/view.theme.php +++ b/themes/danbooru/view.theme.php @@ -53,11 +53,12 @@ class CustomViewPostTheme extends ViewPostTheme } if (Extension::is_enabled(RatingsInfo::KEY)) { - if ($image['rating'] === null || $image['rating'] == "?") { - $image['rating'] = "?"; + $rating = $image['rating']; + if ($rating === null) { + $rating = "?"; } - $h_rating = Ratings::rating_to_human($image['rating']); - $html .= "
Rating: $h_rating"; + $h_rating = Ratings::rating_to_human($rating); + $html .= "
Rating: $h_rating"; } return $html; diff --git a/themes/danbooru2/view.theme.php b/themes/danbooru2/view.theme.php index 3720f907..f81b0a0e 100644 --- a/themes/danbooru2/view.theme.php +++ b/themes/danbooru2/view.theme.php @@ -54,14 +54,12 @@ class CustomViewPostTheme extends ViewPostTheme } if (Extension::is_enabled(RatingsInfo::KEY)) { - if ($image['rating'] === null || $image['rating'] == "?") { - $image['rating'] = "?"; - } - // @phpstan-ignore-next-line - ??? - if (Extension::is_enabled(RatingsInfo::KEY)) { - $h_rating = Ratings::rating_to_human($image['rating']); - $html .= "
Rating: $h_rating"; + $rating = $image['rating']; + if ($rating === null) { + $rating = "?"; } + $h_rating = Ratings::rating_to_human($rating); + $html .= "
Rating: $h_rating"; } return $html; diff --git a/themes/lite/view.theme.php b/themes/lite/view.theme.php index 467477ea..5194fd99 100644 --- a/themes/lite/view.theme.php +++ b/themes/lite/view.theme.php @@ -58,11 +58,12 @@ class CustomViewPostTheme extends ViewPostTheme } if (Extension::is_enabled(RatingsInfo::KEY)) { - if ($image['rating'] === null || $image['rating'] == "?") { - $image['rating'] = "?"; + $rating = $image['rating']; + if ($rating === null) { + $rating = "?"; } - $h_rating = Ratings::rating_to_human($image['rating']); - $html .= "
Rating: $h_rating"; + $h_rating = Ratings::rating_to_human($rating); + $html .= "
Rating: $h_rating"; } return $html;