Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15464021
D7561.id17056.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
917 B
Referenced Files
None
Subscribers
None
D7561.id17056.diff
View Options
Index: src/aphront/AphrontRequest.php
===================================================================
--- src/aphront/AphrontRequest.php
+++ src/aphront/AphrontRequest.php
@@ -471,9 +471,23 @@
// underscores, then prepending 'HTTP_'.
$php_index = strtoupper($name);
$php_index = str_replace('-', '_', $php_index);
- $php_index = 'HTTP_'.$php_index;
- return idx($_SERVER, $php_index, $default);
+ $try_names = array();
+
+ $try_names[] = 'HTTP_'.$php_index;
+ if ($name == 'CONTENT_TYPE' || $name == 'CONTENT_LENGTH') {
+ // These headers may be avilable under alternate names. See
+ // http://www.php.net/manual/en/reserved.variables.server.php#110763
+ $try_names[] = $name;
+ }
+
+ foreach ($try_names as $try_name) {
+ if (array_key_exists($try_name, $_SERVER)) {
+ return $_SERVER[$try_name];
+ }
+ }
+
+ return $default;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 3, 5:32 AM (3 d, 23 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7729990
Default Alt Text
D7561.id17056.diff (917 B)
Attached To
Mode
D7561: Fix an issue where PHP puts the content type in CONTENT_TYPE instead of HTTP_CONTENT_TYPE
Attached
Detach File
Event Timeline
Log In to Comment