From 9616538d9cbcd2a25177a1265b684228b95f91c3 Mon Sep 17 00:00:00 2001 From: Josef Citrine Date: Mon, 15 May 2017 18:17:09 +0100 Subject: [PATCH] Switched to a file whitelist --- app/Console/Commands/ImportPonify.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/ImportPonify.php b/app/Console/Commands/ImportPonify.php index 47070e67..87442104 100644 --- a/app/Console/Commands/ImportPonify.php +++ b/app/Console/Commands/ImportPonify.php @@ -41,7 +41,7 @@ class ImportPonify extends Command * * @var array */ - protected $ignoredExtensions = ['db', 'jpg', 'png']; + protected $allowedExtensions = ['mp3', 'aif', 'aiff', 'wav', 'flac', 'm4a', 'ogg']; /** * Used to stop the import process when a SIGINT is received. * @@ -128,7 +128,7 @@ class ImportPonify extends Command $this->comment('[' . $this->currentFile . '/' . $totalFiles . '] Importing track [' . $file->getFilename() . ']...'); - if (in_array($file->getExtension(), $this->ignoredExtensions)) { + if (!in_array($file->getExtension(), $this->allowedExtensions)) { $this->comment('This is not an audio file! Skipping...' . PHP_EOL); continue; }