summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorccd0 <admin@containerchan.org>2013-12-09 05:36:26 -0800
committerccd0 <admin@containerchan.org>2013-12-09 05:36:26 -0800
commit84329fb6ff1e06e02be2b2f21a09a28216c3409b (patch)
tree2ba5f0a6388f7ad53d0bd71a3017fa8d89d242e8
parent16adc1ff05fa5e6e531c90e0c91b519fe3474a79 (diff)
check that uploads are WebM files
-rw-r--r--posthandler.php1
-rw-r--r--videodata.php1
2 files changed, 2 insertions, 0 deletions
diff --git a/posthandler.php b/posthandler.php
index f2f60291..639254e1 100644
--- a/posthandler.php
+++ b/posthandler.php
@@ -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';
diff --git a/videodata.php b/videodata.php
index 1b1e7eb6..9bf26396 100644
--- a/videodata.php
+++ b/videodata.php
@@ -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');