check that uploads are WebM files

This commit is contained in:
ccd0 2013-12-09 05:36:26 -08:00
parent 16adc1ff05
commit 84329fb6ff
2 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,7 @@ function postHandler($post) {
if ($post->has_file && $post->extension == 'webm') {
require_once dirname(__FILE__) . '/videodata.php';
$videoDetails = videoData($post->file_path);
if (!isset($videoDetails['container']) || $videoDetails['container'] != 'webm') return "not a WebM file";
// Set thumbnail
$thumbName = $board['dir'] . $config['dir']['thumb'] . $post->file_id . '.webm';

View File

@ -107,6 +107,7 @@ function videoData($filename) {
try {
$root = readMatroska($fileHandle);
$data['container'] = $root->get('EBML')->get('DocType');
// Locate segment information and tracks
$segment = $root->get('Segment');