From 82dc200f17836b1d655eb3640fa480677caa29b9 Mon Sep 17 00:00:00 2001 From: Peter Deltchev Date: Mon, 7 Sep 2015 07:35:25 -0700 Subject: [PATCH] T357: Continue restricting lossy user-facing uploads. --- app/library/PfmValidator.php | 1 - app/models/Commands/UploadTrackCommand.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/library/PfmValidator.php b/app/library/PfmValidator.php index 0d98c6cf..ffb24c9e 100644 --- a/app/library/PfmValidator.php +++ b/app/library/PfmValidator.php @@ -25,7 +25,6 @@ // value is the file array itself // parameters is a list of formats the file can be, verified via ffmpeg $file = AudioCache::get($value->getPathname()); - var_dump($file->getAudioCodec()); return in_array($file->getAudioCodec(), $parameters); } diff --git a/app/models/Commands/UploadTrackCommand.php b/app/models/Commands/UploadTrackCommand.php index 17467db7..2a9f8cdb 100644 --- a/app/models/Commands/UploadTrackCommand.php +++ b/app/models/Commands/UploadTrackCommand.php @@ -45,7 +45,7 @@ $validator = \Validator::make(['track' => $trackFile], [ 'track' => 'required|' - . $this->_allowLossy ? '' : 'audio_format:'.implode(',', $this->_losslessFormats).'|' + . ($this->_allowLossy ? '' : 'audio_format:'. implode(',', $this->_losslessFormats).'|') . 'audio_channels:1,2|' . 'sample_rate:44100,48000,88200,96000,176400,192000|' . 'min_duration:30'