diff options
Diffstat (limited to 'program/include/rcube_shared.inc')
-rw-r--r-- | program/include/rcube_shared.inc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc index acf98c938..eeca2b57a 100644 --- a/program/include/rcube_shared.inc +++ b/program/include/rcube_shared.inc @@ -523,6 +523,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 * |