need to strtolower() the key first before we ucfirst() it.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 29 Mar 2010 18:56:21 +0000 (14:56 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 29 Mar 2010 18:56:21 +0000 (14:56 -0400)
I'm thinking it might be easier to just put these in as-is, and
assume we need to strtolower() any X-* headers for comparison.

RFC2616 (HTTP/1.1) says headers are case insensitive anyway, so we probably
shouldn't be relying on case for comparisons...

framework/Controller/lib/Horde/Controller/Request/Http.php

index 633628f..fe39e74 100644 (file)
@@ -612,9 +612,9 @@ class Horde_Controller_Request_Http extends Horde_Controller_Request_Base
                 // Try to work with what we have...
                 $hdr_key = substr($k, 5);
                 $tokens = explode('_', $hdr_key);
-                if (count($tokens) > 0 && strlen($hdr_key) > 2) {
+                if (count($tokens) > 0) {
                     foreach($tokens as $key => $value) {
-                        $tokens[$key] = ucfirst($value);
+                        $tokens[$key] = ucfirst(strtolower($value));
                     }
                     $hdr_key = implode('-', $tokens);
                     $mapped_result[$hdr_key] = $v;