prevent opening non-music files through the media ajax api

This commit is contained in:
Robin Appelman 2012-06-09 17:39:14 +02:00
parent 601bac746d
commit d065b2d29e
1 changed files with 4 additions and 0 deletions

View File

@ -103,6 +103,10 @@ if($arguments['action']){
@ob_end_clean();
$ftype=OC_Filesystem::getMimeType( $arguments['path'] );
if(substr($ftype,0,5)!='audio' and $ftype!='application/ogg'){
echo 'Not an audio file';
exit();
}
$songId=OC_MEDIA_COLLECTION::getSongByPath($arguments['path']);
OC_MEDIA_COLLECTION::registerPlay($songId);