diff --git a/api/autoload.php b/api/autoload.php index 0f14ff20..33ac8300 100644 --- a/api/autoload.php +++ b/api/autoload.php @@ -23,4 +23,17 @@ require_once(__DIR__ . '/../inc/custom_fields.inc.php'); // Load the ApplicationContext $builder = new \DI\ContainerBuilder(); -$applicationContext = $builder->build(); \ No newline at end of file +$applicationContext = $builder->build(); + +// Fix for getallheaders() on PHP-FPM and nginx +if (!function_exists('getallheaders')) { + function getallheaders() { + $headers = []; + foreach ($_SERVER as $name => $value) { + if (substr($name, 0, 5) == 'HTTP_') { + $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value; + } + } + return $headers; + } +} \ No newline at end of file