From bb0bc198539fb9853f8a04e393cac2ae79c09864 Mon Sep 17 00:00:00 2001 From: lachlan Date: Tue, 31 Aug 2021 09:17:33 +1000 Subject: [PATCH] scrub some link names just in case you're trying to break things --- src/Repository/Model/Album.php | 4 ++-- src/Repository/Model/Artist.php | 2 +- src/Repository/Model/Label.php | 2 +- src/Repository/Model/Movie.php | 2 +- src/Repository/Model/Playlist.php | 2 +- src/Repository/Model/Podcast.php | 2 +- src/Repository/Model/Search.php | 2 +- src/Repository/Model/TVShow_Episode.php | 2 +- src/Repository/Model/User.php | 2 +- src/Repository/Model/Wanted.php | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Repository/Model/Album.php b/src/Repository/Model/Album.php index 7c27122b65..5600ef60b5 100644 --- a/src/Repository/Model/Album.php +++ b/src/Repository/Model/Album.php @@ -595,7 +595,7 @@ public function format($details = true, $limit_threshold = '') $album_artist->format(); $this->album_artist_name = $album_artist->name; $this->f_album_artist_name = $album_artist->f_name; - $this->f_album_artist_link = "album_artist . "\" title=\"" . scrub_out($this->album_artist_name) . "\">" . $this->f_album_artist_name . ""; + $this->f_album_artist_link = "album_artist . "\" title=\"" . scrub_out($this->album_artist_name) . "\">" . scrub_out($this->f_album_artist_name) . ""; } $this->tags = Tag::get_top_tags('album', $this->id); @@ -620,7 +620,7 @@ public function format($details = true, $limit_threshold = '') if ($this->artist_count == '1') { $artist = trim(trim((string)$this->artist_prefix) . ' ' . trim((string)$this->artist_name)); $this->f_artist_name = $artist; - $this->f_artist_link = "album_artist . "\" title=\"" . scrub_out($this->artist_name) . "\">" . $artist . ""; + $this->f_artist_link = "album_artist . "\" title=\"" . scrub_out($this->artist_name) . "\">" . scrub_out($artist) . ""; $this->f_artist = $artist; } else { $this->f_artist_link = "artist_count " . T_('Artists') . "\">" . T_('Various') . ""; diff --git a/src/Repository/Model/Artist.php b/src/Repository/Model/Artist.php index d9dcd9f81e..36d2ad0a92 100644 --- a/src/Repository/Model/Artist.php +++ b/src/Repository/Model/Artist.php @@ -473,7 +473,7 @@ public function format($details = true, $limit_threshold = '') $this->link = ($this->catalog_id) ? AmpConfig::get('web_path') . '/artists.php?action=show&catalog=' . $this->catalog_id . '&artist=' . $this->id : AmpConfig::get('web_path') . '/artists.php?action=show&artist=' . $this->id; - $this->f_link = "link . "\" title=\"" . $this->f_name . "\">" . $this->f_name . ""; + $this->f_link = "link . "\" title=\"" . scrub_out($this->f_name) . "\">" . scrub_out($this->f_name) . ""; if ($details) { $min = sprintf("%02d", (floor($this->time / 60) % 60)); diff --git a/src/Repository/Model/Label.php b/src/Repository/Model/Label.php index e3e23c312c..c02e49ab95 100644 --- a/src/Repository/Model/Label.php +++ b/src/Repository/Model/Label.php @@ -144,7 +144,7 @@ public function format($details = true) unset($details); $this->f_name = scrub_out($this->name); $this->link = AmpConfig::get('web_path') . '/labels.php?action=show&label=' . scrub_out($this->id); - $this->f_link = "link . "\" title=\"" . $this->f_name . "\">" . $this->f_name; + $this->f_link = "link . "\" title=\"" . scrub_out($this->f_name) . "\">" . scrub_out($this->f_name); $this->artists = count($this->get_artists()); } diff --git a/src/Repository/Model/Movie.php b/src/Repository/Model/Movie.php index 38b0f6518a..927b2c19da 100644 --- a/src/Repository/Model/Movie.php +++ b/src/Repository/Model/Movie.php @@ -138,7 +138,7 @@ public function format($details = true) $this->f_original_name = trim((string)$this->prefix . " " . $this->f_title); $this->f_title = ($this->f_original_name ?: $this->f_title); $this->f_full_title = $this->f_title; - $this->f_link = '' . $this->f_title . ''; + $this->f_link = '' . scrub_out($this->f_title) . ''; return true; } // format diff --git a/src/Repository/Model/Playlist.php b/src/Repository/Model/Playlist.php index 240462968c..bbc4e9ab0e 100644 --- a/src/Repository/Model/Playlist.php +++ b/src/Repository/Model/Playlist.php @@ -271,7 +271,7 @@ public function format($details = true) { parent::format($details); $this->link = AmpConfig::get('web_path') . '/playlist.php?action=show_playlist&playlist_id=' . $this->id; - $this->f_link = '' . $this->f_name . ''; + $this->f_link = '' . scrub_out($this->f_name) . ''; $this->f_date = $this->date ? get_datetime((int)$this->date) : T_('Unknown'); $this->f_last_update = $this->last_update ? get_datetime((int)$this->last_update) : T_('Unknown'); diff --git a/src/Repository/Model/Podcast.php b/src/Repository/Model/Podcast.php index ed8350cb2d..fd76c75f96 100644 --- a/src/Repository/Model/Podcast.php +++ b/src/Repository/Model/Podcast.php @@ -149,7 +149,7 @@ public function format($details = true) $this->f_lastbuilddate = date("c", (int)$this->lastbuilddate); $this->f_lastsync = date("c", (int)$this->lastsync); $this->link = AmpConfig::get('web_path') . '/podcast.php?action=show&podcast=' . $this->id; - $this->f_link = '' . $this->f_title . ''; + $this->f_link = '' . scrub_out($this->f_title) . ''; $this->f_website_link = "website . "\">" . $this->website . ""; return true; diff --git a/src/Repository/Model/Search.php b/src/Repository/Model/Search.php index 10917c7b92..bfe6a2263c 100755 --- a/src/Repository/Model/Search.php +++ b/src/Repository/Model/Search.php @@ -1018,7 +1018,7 @@ public function format($details = true) parent::format(); $this->link = AmpConfig::get('web_path') . '/smartplaylist.php?action=show_playlist&playlist_id=' . $this->id; - $this->f_link = '' . $this->f_name . ''; + $this->f_link = '' . scrub_out($this->f_name) . ''; } /** diff --git a/src/Repository/Model/TVShow_Episode.php b/src/Repository/Model/TVShow_Episode.php index 09a2a9fb23..c2962c92df 100644 --- a/src/Repository/Model/TVShow_Episode.php +++ b/src/Repository/Model/TVShow_Episode.php @@ -180,7 +180,7 @@ public function format($details = true) $season->format($details); $this->f_title = ($this->original_name ?: $this->f_title); - $this->f_link = '' . $this->f_title . ''; + $this->f_link = '' . scrub_out($this->f_title) . ''; $this->f_season = $season->f_name; $this->f_season_link = $season->f_link; $this->f_tvshow = $season->f_tvshow; diff --git a/src/Repository/Model/User.php b/src/Repository/Model/User.php index 2e270fcf8b..b980e2e588 100644 --- a/src/Repository/Model/User.php +++ b/src/Repository/Model/User.php @@ -1013,7 +1013,7 @@ public function format($details = true) // Base link $this->link = AmpConfig::get('web_path') . '/stats.php?action=show_user&user_id=' . $this->id; - $this->f_link = '' . $this->f_name . ''; + $this->f_link = '' . scrub_out($this->f_name) . ''; if ($details) { $user_data = self::get_user_data($this->id); diff --git a/src/Repository/Model/Wanted.php b/src/Repository/Model/Wanted.php index ba6f5132c7..58fd7743f7 100644 --- a/src/Repository/Model/Wanted.php +++ b/src/Repository/Model/Wanted.php @@ -447,7 +447,7 @@ public function format() $this->f_artist_link = $wartist['link']; } $this->link = AmpConfig::get('web_path') . "/albums.php?action=show_missing&mbid=" . $this->mbid . "&artist=" . $this->artist . "&artist_mbid=" . $this->artist_mbid . "\" title=\"" . $this->name; - $this->f_link = "link . "\">" . $this->name . ""; + $this->f_link = "link . "\">" . scrub_out($this->name) . ""; $user = new User($this->user); $user->format(); $this->f_user = $user->f_name;