summaryrefslogtreecommitdiff
path: root/program/include/rcube_shared.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2007-08-13 20:15:27 +0000
committerthomascube <thomas@roundcube.net>2007-08-13 20:15:27 +0000
commit88f66ec89cf87328536757ac33e508a9614bdc09 (patch)
tree9cf780128deed4c714a6e74c38e4b790317082ae /program/include/rcube_shared.inc
parent8810b6db0f7ea63313e660203b8519a6ea98e5be (diff)
Fix bugs introduced with latest changes
Diffstat (limited to 'program/include/rcube_shared.inc')
-rw-r--r--program/include/rcube_shared.inc21
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
*