Skip to content

Commit

Permalink
Clean filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljamesscott committed Jan 17, 2011
1 parent 41c9978 commit 9d77744
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion music.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 3 additions & 1 deletion views/album/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
}
Expand Down
2 changes: 1 addition & 1 deletion views/artist/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 3 additions & 0 deletions views/artist/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 9d77744

Please sign in to comment.