SAAS-595 - Updated validation and sanitization

This commit is contained in:
Duncan Sommerville 2015-02-17 12:17:49 -05:00
parent eb40379152
commit a07a1edcc0
4 changed files with 57 additions and 16 deletions

View file

@ -0,0 +1,20 @@
<?php
/**
* Created by PhpStorm.
* User: sourcefabric
* Date: 17/02/15
*/
class FileDataHelper {
/**
* We want to throw out invalid data and process the upload successfully
* at all costs, so check the data and sanitize it if necessary
* @param array $data array containing new file metadata
*/
public static function sanitizeData(&$data) {
// If the track number isn't numeric, this will return 0
$data["track_number"] = intval($data["track_number"]);
}
}