Merge branch 'cc-5709-airtime-analyzer-store-file-size-and-hash-in-db' into saas-store-file-size-and-hash-in-db
Conflicts: airtime_mvc/application/Bootstrap.php airtime_mvc/application/modules/rest/controllers/MediaController.php
This commit is contained in:
commit
c1086842d3
6 changed files with 54 additions and 4 deletions
|
@ -119,6 +119,9 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
$file->save();
|
||||
return;
|
||||
} else {
|
||||
// Sanitize any incorrect metadata that slipped past validation
|
||||
FileDataHelper::sanitizeData($whiteList["track_number"]);
|
||||
|
||||
/* If full_path is set, the post request came from ftp.
|
||||
* Users are allowed to upload folders via ftp. If this is the case
|
||||
* we need to include the folder name with the file name, otherwise
|
||||
|
@ -172,6 +175,9 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
$file->save();
|
||||
return;
|
||||
} else if ($file && isset($requestData["resource_id"])) {
|
||||
// Sanitize any incorrect metadata that slipped past validation
|
||||
FileDataHelper::sanitizeData($whiteList["track_number"]);
|
||||
|
||||
$file->fromArray($whiteList, BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
//store the original filename
|
||||
|
@ -200,8 +206,12 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
->setHttpResponseCode(200)
|
||||
->appendBody(json_encode(CcFiles::sanitizeResponse($file)));
|
||||
} else if ($file) {
|
||||
// Sanitize any incorrect metadata that slipped past validation
|
||||
$this->sanitizeData($file, $whiteList);
|
||||
|
||||
//local file storage
|
||||
$file->setDbDirectory(self::MUSIC_DIRS_STOR_PK);
|
||||
|
||||
$file->fromArray($whiteList, BasePeer::TYPE_FIELDNAME);
|
||||
//Our RESTful API takes "full_path" as a field, which we then split and translate to match
|
||||
//our internal schema. Internally, file path is stored relative to a directory, with the directory
|
||||
|
@ -299,7 +309,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
$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