From 10b95da1ed18f629c3146cc2e18fffc1ba61fe2a Mon Sep 17 00:00:00 2001 From: thomasb Date: Mon, 13 Aug 2007 20:15:27 +0000 Subject: Fix bugs introduced with latest changes git-svn-id: https://svn.roundcube.net/trunk@675 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/include/rcube_shared.inc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'roundcubemail/program/include/rcube_shared.inc') diff --git a/roundcubemail/program/include/rcube_shared.inc b/roundcubemail/program/include/rcube_shared.inc index acf98c938..eeca2b57a 100644 --- a/roundcubemail/program/include/rcube_shared.inc +++ b/roundcubemail/program/include/rcube_shared.inc @@ -522,6 +522,27 @@ function rc_strrpos($haystack, $needle, $offset=0) } +/** + * Read a specific HTTP request header + * + * @param string Header name + * @return string Header value or null if not available + */ +function rc_request_header($name) +{ + if (function_exists('getallheaders')) + { + $hdrs = getallheaders(); + return $hdrs[$name]; + } + else + { + $key = "HTTP_" . strtoupper(strtr($name, "-", "_")); + return $_SERVER[$key]; + } +} + + /** * Replace the middle part of a string with ... * if it is longer than the allowed length -- cgit v1.2.3