Browse Source

check that uploads are WebM files

pull/40/head
ccd0 11 years ago
parent
commit
84329fb6ff
  1. 1
      posthandler.php
  2. 1
      videodata.php

1
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';

1
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');

Loading…
Cancel
Save