CC-3391: Audio Preview cannot play tracks with commas in their filename

- The content distribution header filename attribute, wasn't properly quoted for inline content. This causes a bug for files with comma names.
- changed the play button in library back to the speaker icon
- removed some dead code preview_player.js
- removed the file name attribute, will need better approch to presenting the user with audio information.
This commit is contained in:
Daniel 2012-03-06 13:50:07 -05:00
parent 348011dbc3
commit 709e117f41
8 changed files with 22 additions and 67 deletions

View file

@ -116,10 +116,9 @@ class ApiController extends Zend_Controller_Action
return;
}
$name = $this->_getParam("name");
$filename = $this->_getParam("filename");
$file_id = substr($filename, 0, strpos($filename, "."));
$fileID = $this->_getParam("fileID");
$file_id = substr($fileID, 0, strpos($fileID, "."));
if (ctype_alnum($file_id) && strlen($file_id) == 32)
{
$media = Application_Model_StoredFile::RecallByGunid($file_id);
@ -132,7 +131,7 @@ class ApiController extends Zend_Controller_Action
$file_base_name = substr($file_base_name, 1);
// possibly use fileinfo module here in the future.
// http://www.php.net/manual/en/book.fileinfo.php
$ext = pathinfo($filename, PATHINFO_EXTENSION);
$ext = pathinfo($fileID, PATHINFO_EXTENSION);
//Download user left clicks a track and selects Download.
if ("true" == $this->_getParam('download')){
//path_info breaks up a file path into seperate pieces of informaiton.
@ -146,7 +145,7 @@ class ApiController extends Zend_Controller_Action
header('Content-Disposition: attachment; filename="'.$file_base_name.'"');
}else{
//user clicks play button for track and downloads it.
header("Content-Disposition: inline; filename=$file_base_name");
header('Content-Disposition: inline; filename="'.$file_base_name.'"');
}
$this->smartReadFile($filepath, $ext);

View file

@ -198,8 +198,7 @@ class PlaylistController extends Zend_Controller_Action
public function audioPreviewPlayerAction()
{
$name = $this->_getParam('name');
$fileName = $this->_getParam('filename');
$fileID = $this->_getParam('fileID');
$playlistIndex = $this->_getParam('index');
$request = $this->getRequest();
@ -218,8 +217,7 @@ class PlaylistController extends Zend_Controller_Action
$this->view->logo = "$baseUrl/css/images/airtime_logo_jp.png";
}
$this->view->name = $name;
$this->view->fileName = $fileName;
$this->view->fileName = $fileID;
$this->view->playlistIndex= $playlistIndex;
}