Fixing file metadata sanitization
This commit is contained in:
parent
29c6ae15b0
commit
29d7e20622
|
@ -446,7 +446,7 @@ class LibraryController extends Zend_Controller_Action
|
||||||
|
|
||||||
if ($form->isValid($serialized)) {
|
if ($form->isValid($serialized)) {
|
||||||
// Sanitize any incorrect metadata that slipped past validation
|
// Sanitize any incorrect metadata that slipped past validation
|
||||||
FileDataHelper::sanitizeData($serialized["track_number"]);
|
FileDataHelper::sanitizeData($serialized);
|
||||||
|
|
||||||
$formValues = $this->_getParam('data', null);
|
$formValues = $this->_getParam('data', null);
|
||||||
$formdata = array();
|
$formdata = array();
|
||||||
|
|
|
@ -120,7 +120,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
// Sanitize any incorrect metadata that slipped past validation
|
// Sanitize any incorrect metadata that slipped past validation
|
||||||
FileDataHelper::sanitizeData($whiteList["track_number"]);
|
FileDataHelper::sanitizeData($whiteList);
|
||||||
|
|
||||||
/* If full_path is set, the post request came from ftp.
|
/* If full_path is set, the post request came from ftp.
|
||||||
* Users are allowed to upload folders via ftp. If this is the case
|
* Users are allowed to upload folders via ftp. If this is the case
|
||||||
|
@ -176,7 +176,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
||||||
return;
|
return;
|
||||||
} else if ($file && isset($requestData["resource_id"])) {
|
} else if ($file && isset($requestData["resource_id"])) {
|
||||||
// Sanitize any incorrect metadata that slipped past validation
|
// Sanitize any incorrect metadata that slipped past validation
|
||||||
FileDataHelper::sanitizeData($whiteList["track_number"]);
|
FileDataHelper::sanitizeData($whiteList);
|
||||||
|
|
||||||
$file->fromArray($whiteList, BasePeer::TYPE_FIELDNAME);
|
$file->fromArray($whiteList, BasePeer::TYPE_FIELDNAME);
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ class Rest_MediaController extends Zend_Rest_Controller
|
||||||
->appendBody(json_encode(CcFiles::sanitizeResponse($file)));
|
->appendBody(json_encode(CcFiles::sanitizeResponse($file)));
|
||||||
} else if ($file) {
|
} else if ($file) {
|
||||||
// Sanitize any incorrect metadata that slipped past validation
|
// Sanitize any incorrect metadata that slipped past validation
|
||||||
$this->sanitizeData($file, $whiteList);
|
FileDataHelper::sanitizeData($whiteList);
|
||||||
|
|
||||||
//local file storage
|
//local file storage
|
||||||
$file->setDbDirectory(self::MUSIC_DIRS_STOR_PK);
|
$file->setDbDirectory(self::MUSIC_DIRS_STOR_PK);
|
||||||
|
|
Loading…
Reference in New Issue