php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #61807
Patch apache_request_headers.phpt revision 2012-05-05 06:20 UTC by remi@php.net
Patch apache_request_headers.patch revision 2012-05-05 06:19 UTC by remi@php.net
Patch php-apache-request-headers.patch revision 2012-04-22 01:12 UTC by nyt-php at countercultured dot net

Patch apache_request_headers.patch for CGI/CLI related Bug #61807

Patch version 2012-05-05 06:19 UTC

Return to Bug #61807 | Download this patch
Patch Revisions:

Developer: remi@php.net

diff -up sapi/cgi/cgi_main.c.old sapi/cgi/cgi_main.c
--- sapi/cgi/cgi_main.c.old	2012-05-04 14:35:07.429340843 +0200
+++ sapi/cgi/cgi_main.c	2012-05-04 14:44:32.352354375 +0200
@@ -1614,15 +1614,21 @@ PHP_FUNCTION(apache_request_headers) /*
 				p = var + 5;
 
 				var = q = t;
+                                // First char keep uppercase
 				*q++ = *p++;
 				while (*p) {
-					if (*p == '_') {
+					if (*p == '=') {
+                                               // End of name
+                                               break;
+                                        } else if (*p == '_') {
 						*q++ = '-';
 						p++;
-						if (*p) {
+                                                // First char after - keep uppercase
+						if (*p && *p!='=' && *p!='_') {
 							*q++ = *p++;
 						}
 					} else if (*p >= 'A' && *p <= 'Z') {
+                                                // lowercase
 						*q++ = (*p++ - 'A' + 'a');
 					} else {
 						*q++ = *p++;
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 08:02:33 2014 UTC