SAAS-595 - Updated validation and sanitization
This commit is contained in:
parent
eb40379152
commit
a07a1edcc0
4 changed files with 57 additions and 16 deletions
20
airtime_mvc/application/common/FileDataHelper.php
Normal file
20
airtime_mvc/application/common/FileDataHelper.php
Normal 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"]);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue