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)
This commit is contained in:
robert 2011-04-02 15:42:18 +00:00
parent bac0534b21
commit 1689f9c64b
2 changed files with 30 additions and 1 deletions

View File

@ -1,10 +1,12 @@
# $OpenBSD: Makefile,v 1.8 2011/03/07 19:50:26 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.9 2011/04/02 15:42:18 robert Exp $
COMMENT= ActiveSync protocol implementation
DISTNAME= z-push-1.5
CATEGORIES= mail www
REVISION= 0
HOMEPAGE= http://z-push.sourceforge.net/
MAINTAINER= Antoine Jacoutot <ajacoutot@openbsd.org>

View File

@ -0,0 +1,27 @@
$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);