diff options
author | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-06-07 06:46:48 +0000 |
---|---|---|
committer | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-06-07 06:46:48 +0000 |
commit | 2f7068c18d5d1199bc3e07b93a4cfcf1182f5a6e (patch) | |
tree | eb7b0845107b4684ebe6e59aeb95c88016be45f8 /lib/class | |
parent | 3de4f6f3e182c153f973510dbc4c824761af02ad (diff) | |
download | ampache-2f7068c18d5d1199bc3e07b93a4cfcf1182f5a6e.tar.gz ampache-2f7068c18d5d1199bc3e07b93a4cfcf1182f5a6e.tar.bz2 ampache-2f7068c18d5d1199bc3e07b93a4cfcf1182f5a6e.zip |
Aggressively make sure we don't end up with extra spaces when joining the prefix.
Diffstat (limited to 'lib/class')
-rw-r--r-- | lib/class/album.class.php | 11 | ||||
-rw-r--r-- | lib/class/artist.class.php | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/class/album.class.php b/lib/class/album.class.php index 3e56151e..cf00b309 100644 --- a/lib/class/album.class.php +++ b/lib/class/album.class.php @@ -59,7 +59,7 @@ class Album extends database_object { } // Little bit of formating here - $this->full_name = trim($info['prefix'] . ' ' . $info['name']); + $this->full_name = trim(trim($info['prefix']) . ' ' . trim($info['name'])); return true; @@ -230,13 +230,16 @@ class Album extends database_object { $this->f_link = $this->f_name_link; $this->f_title = $full_name; if ($this->artist_count == '1') { - $artist = scrub_out(truncate_with_ellipsis(trim($this->artist_prefix . ' ' . $this->artist_name),Config::get('ellipse_threshold_artist'))); + $artist = trim(trim($this->artist_prefix) . ' ' . trim($this->artist_name)); + $this->f_artist_name = $artist; + $artist = scrub_out(truncate_with_ellipsis($artist), Config::get('ellipse_threshold_artist')); $this->f_artist_link = "<a href=\"$web_path/artists.php?action=show&artist=" . $this->artist_id . "\" title=\"" . scrub_out($this->artist_name) . "\">" . $artist . "</a>"; $this->f_artist = $artist; } else { $this->f_artist_link = "<span title=\"$this->artist_count " . _('Artists') . "\">" . _('Various') . "</span>"; $this->f_artist = _('Various'); + $this->f_artist_name = $this->f_artist; } if ($this->year == '0') { @@ -248,10 +251,6 @@ class Album extends database_object { $this->f_tags = Tag::get_display($tags,$this->id,'album'); - - // Format the artist name to include the prefix - $this->f_artist_name = trim($this->artist_prefix . ' ' . $this->artist_name); - } // format /** diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php index c30b20e4..2520346c 100644 --- a/lib/class/artist.class.php +++ b/lib/class/artist.class.php @@ -222,7 +222,7 @@ class Artist extends database_object { /* Combine prefix and name, trim then add ... if needed */ $name = truncate_with_ellipsis(trim($this->prefix . " " . $this->name),Config::get('ellipse_threshold_artist')); $this->f_name = $name; - $this->f_full_name = trim($this->prefix . " " . $this->name); + $this->f_full_name = trim(trim($this->prefix) . ' ' . trim($this->name)); // If this is a fake object, we're done here if ($this->_fake) { return true; } |