From c39b99da6cb5d39e55c5074358d67bf767421c9f Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Thu, 7 Feb 2013 15:42:06 -0500 Subject: [PATCH] CC-4839: Nginx doesn't allow liquidsoap to check uploaded file, which blocks uploading any file -fixed --- airtime_mvc/application/models/StoredFile.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 9ca6ff32c..769f6176e 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -1026,8 +1026,10 @@ SQL; $LIQUIDSOAP_ERRORS = array('TagLib: MPEG::Properties::read() -- Could not find a valid last MPEG frame in the stream.'); // Ask Liquidsoap if file is playable - $command = sprintf("/usr/bin/airtime-liquidsoap -c 'output.dummy(audio_to_stereo(single(\"%s\")))' 2>&1", $audio_file); + $ls_command = sprintf('/usr/bin/airtime-liquidsoap -v -c "output.dummy(audio_to_stereo(single(%s)))" 2>&1', + escapeshellarg($audio_file)); + $command = "export PATH=/usr/local/bin:/usr/bin:/bin/usr/bin/ && $ls_command"; exec($command, $output, $rv); $isError = count($output) > 0 && in_array($output[0], $LIQUIDSOAP_ERRORS);