X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/dd32f373a6ce0ce9782ecd4f8bf6abf59246113a..2a665e0f4eeb45c9d57df7dc7f9d853465b5fea9:/src/phorkie/Repository/Post.php diff --git a/src/phorkie/Repository/Post.php b/src/phorkie/Repository/Post.php index 09cb977..a61f2a2 100644 --- a/src/phorkie/Repository/Post.php +++ b/src/phorkie/Repository/Post.php @@ -234,6 +234,12 @@ class Repository_Post public function getType($content, $returnError = false) { + if (getenv('PATH') == '') { + //php-fpm does not fill $PATH by default + // we have to work around that since System::which() uses it + putenv('PATH=/usr/local/bin:/usr/bin:/bin'); + } + $tmp = tempnam(sys_get_temp_dir(), 'phorkie-autodetect-'); file_put_contents($tmp, $content); $type = Tool_MIME_Type_PlainDetect::autoDetect($tmp);