Index: program/include/rcube_shared.inc
===================================================================
--- program/include/rcube_shared.inc	(revision 88f66ec89cf87328536757ac33e508a9614bdc09)
+++ program/include/rcube_shared.inc	(revision 0144c50fc474c5f0145f3ac1fd2f0d2360e21695)
@@ -526,20 +526,27 @@
  * Read a specific HTTP request header
  *
- * @param string Header name
- * @return string Header value or null if not available
+ * @access static
+ * @param  string $name Header name
+ * @return mixed  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];
-  }
-}
+    $hdrs = array_change_key_case($hdrs, CASE_UPPER);
+    $key  = strtoupper($name);
+    }
+  else
+    {
+    $key  = 'HTTP_' . strtoupper(strtr($name, '-', '_'));
+    $hdrs = array_change_key_case($_SERVER[$key], CASE_UPPER);
+    }
+  if (isset($hdrs[$key]))
+    {
+    return $hdrs[$key];
+    }
+  return null;
+  }
 
 
