Merge branch 'cc-5709-airtime-analyzer' into saas
Conflicts: airtime_mvc/application/Bootstrap.php airtime_mvc/application/modules/rest/controllers/MediaController.php
This commit is contained in:
commit
964d7d1326
5 changed files with 34 additions and 19 deletions
|
@ -172,6 +172,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
$file->save();
|
||||
return;
|
||||
} else if ($file && isset($requestData["resource_id"])) {
|
||||
|
||||
$file->fromArray($whiteList, BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
//store the original filename
|
||||
|
@ -200,6 +201,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
->setHttpResponseCode(200)
|
||||
->appendBody(json_encode(CcFiles::sanitizeResponse($file)));
|
||||
} else if ($file) {
|
||||
|
||||
//local file storage
|
||||
$file->setDbDirectory(self::MUSIC_DIRS_STOR_PK);
|
||||
$file->fromArray($whiteList, BasePeer::TYPE_FIELDNAME);
|
||||
|
@ -294,12 +296,15 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
|
||||
private function validateRequestData($file, &$whiteList)
|
||||
{
|
||||
// Sanitize any wildly incorrect metadata before it goes to be validated
|
||||
FileDataHelper::sanitizeData($whiteList);
|
||||
|
||||
try {
|
||||
// EditAudioMD form is used here for validation
|
||||
$fileForm = new Application_Form_EditAudioMD();
|
||||
$fileForm->startForm($file->getDbId());
|
||||
$fileForm->populate($whiteList);
|
||||
|
||||
|
||||
/*
|
||||
* Here we are truncating metadata of any characters greater than the
|
||||
* max string length set in the database. In the rare case a track's
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue