openbsd-ports/mail/z-push/patches/patch-index_php
robert 1689f9c64b Define the apache_request_headers() function in php in case we are
using nginx or lighttpd as a webserver and not apache.

ok ajacoutot@ (maintainer)
2011-04-02 15:42:18 +00:00

28 lines
866 B
Plaintext

$OpenBSD: patch-index_php,v 1.1 2011/04/02 15:42:18 robert Exp $
--- index.php.orig Sat Apr 2 15:43:08 2011
+++ index.php Sat Apr 2 15:42:44 2011
@@ -53,6 +53,23 @@ include_once("debug.php");
include_once("compat.php");
include_once("version.php");
+// Define apache_request_headers() in case we are using nginx or lighttpd
+// as a webserver and not apache.
+if (!function_exists("apache_request_headers")) {
+ function apache_request_headers() {
+ $headers = array();
+ foreach ($_SERVER as $key => $value) {
+ if (substr($key, 0, 5) != 'HTTP_') {
+ continue;
+ }
+ $headername = strtr(ucwords(strtolower(strtr(substr($key, 5), '_', ' '))), ' ', '-');
+ $headers[$headername] = $value;
+ }
+
+ return $headers;
+ }
+}
+
// Attempt to set maximum execution time
ini_set('max_execution_time', SCRIPT_TIMEOUT);
set_time_limit(SCRIPT_TIMEOUT);