prevent opening non-music files through the media ajax api

remotes/origin/stable45
Robin Appelman 13 years ago
parent 601bac746d
commit d065b2d29e
  1. 4
      apps/media/ajax/api.php

@ -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);

Loading…
Cancel
Save