From 1689f9c64b8649f8c3a2a2776bb8ff086d3afbb3 Mon Sep 17 00:00:00 2001 From: robert Date: Sat, 2 Apr 2011 15:42:18 +0000 Subject: [PATCH] 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) --- mail/z-push/Makefile | 4 +++- mail/z-push/patches/patch-index_php | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 mail/z-push/patches/patch-index_php diff --git a/mail/z-push/Makefile b/mail/z-push/Makefile index 5d885ae6a3b..10587949ceb 100644 --- a/mail/z-push/Makefile +++ b/mail/z-push/Makefile @@ -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 diff --git a/mail/z-push/patches/patch-index_php b/mail/z-push/patches/patch-index_php new file mode 100644 index 00000000000..77af7cad44e --- /dev/null +++ b/mail/z-push/patches/patch-index_php @@ -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);