Merge branch 'cc-5709-airtime-analyzer' into saas-file-sanitization
Conflicts: airtime_mvc/application/controllers/LibraryController.php airtime_mvc/application/modules/rest/controllers/MediaController.php
This commit is contained in:
commit
9098e204e5
3 changed files with 17 additions and 20 deletions
|
@ -119,9 +119,6 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
$file->save();
|
||||
return;
|
||||
} else {
|
||||
// Sanitize any incorrect metadata that slipped past validation
|
||||
FileDataHelper::sanitizeData($whiteList);
|
||||
|
||||
/* 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
|
||||
|
@ -175,8 +172,6 @@ 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);
|
||||
|
||||
$file->fromArray($whiteList, BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
|
@ -206,8 +201,6 @@ 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
|
||||
FileDataHelper::sanitizeData($whiteList);
|
||||
|
||||
//local file storage
|
||||
$file->setDbDirectory(self::MUSIC_DIRS_STOR_PK);
|
||||
|
@ -304,6 +297,9 @@ 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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue