Permalink
Browse files

Clean filenames

  • Loading branch information...
1 parent 41c9978 commit 9d77744113db7a19faad28e43b36f9b5f037041e Daniel Scott committed Jan 17, 2011
Showing with 8 additions and 3 deletions.
  1. +1 −1 music.xml
  2. +3 −1 views/album/view.html.php
  3. +1 −1 views/artist/tmpl/default.php
  4. +3 −0 views/artist/view.html.php
View
2 music.xml
@@ -8,7 +8,7 @@
<authorUrl>http://danieljamesscott.org</authorUrl>
<copyright>Copyright Daniel Scott 2009</copyright>
<license>GPL V3 or later</license>
- <version>0.12</version>
+ <version>0.13</version>
<description>Music management component</description>
<install>
View
4 views/album/view.html.php
@@ -94,10 +94,12 @@ function display($tpl = null)
$pparams->set('player_plugin_options'," " . $pparams->get('player_plugin_options'));
}
+ // Clean song filename
+ $song->cleaned_mp3 = JFile::makeSafe($song->mp3);
// Wrap the mp3 name in {$player_plugin $player_plugin_options}{/$player_plugin} tags for plugin.
if ($song->mp3 != '') {
// ' ' already added for options above
- $song->plugin_code = JHTML::_('content.prepare',"{" . $pparams->get('player_plugin') . $pparams->get('player_plugin_options') . "}images/songs/" . $song->mp3 . "{/" . $pparams->get('player_plugin') . "}");
+ $song->plugin_code = JHTML::_('content.prepare',"{" . $pparams->get('player_plugin') . $pparams->get('player_plugin_options') . "}images/songs/" . $song->cleaned_mp3 . "{/" . $pparams->get('player_plugin') . "}");
} else {
$song->plugin_code = '';
}
View
2 views/artist/tmpl/default.php
@@ -25,7 +25,7 @@
<?php if ($this->artist->picture == "") {
print JText::_('NOPICTUREAVAIL');
} else { ?>
-<img src="images/artists/<?php echo $this->artist->picture; ?>" hspace="6" height="200px" width="200px" alt="<?php echo $this->artist->name . ' ' . JText::_( 'Picture' ); ?>" />
+<img src="images/artists/<?php echo $this->artist->cleaned_picture; ?>" hspace="6" height="200px" width="200px" alt="<?php echo $this->artist->name . ' ' . JText::_( 'Picture' ); ?>" />
<?php } ?>
<?php } ?>
</td>
View
3 views/artist/view.html.php
@@ -79,6 +79,9 @@ function display($tpl = null)
$albums = $model->getAlbums( $options );
$total = $model->getAlbumCount( $options );
+ // Clean picture filename
+ $artist->cleaned_picture = JFile::makeSafe($artist->picture);
+
//prepare albums
$k = 0;
for($i = 0; $i < count( $albums ); $i++) {

0 comments on commit 9d77744

Please sign in to comment.