From 065e977b3cce22f4d6446d57756f73805acae50c Mon Sep 17 00:00:00 2001 From: hfcorriez Date: Thu, 20 Sep 2012 14:13:55 +0800 Subject: [PATCH] Fix $_SERVER['CONTENT_TYPE'] trigger a NOTICE error See T1762. Reviewed by: epriestley --- src/infrastructure/PhabricatorRequestOverseer.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/infrastructure/PhabricatorRequestOverseer.php b/src/infrastructure/PhabricatorRequestOverseer.php index 0c2b28d274..dfa099a8c3 100644 --- a/src/infrastructure/PhabricatorRequestOverseer.php +++ b/src/infrastructure/PhabricatorRequestOverseer.php @@ -57,7 +57,10 @@ final class PhabricatorRequestOverseer { // // NOTE: We use strncmp() because the actual content type may be something // like "multipart/form-data; boundary=...". - $content_type = $_SERVER['CONTENT_TYPE']; + // + // NOTE: Chrome sometimes omits this header, see some discussion in T1762 + // and http://code.google.com/p/chromium/issues/detail?id=6800 + $content_type = idx($_SERVER, 'CONTENT_TYPE', ''); $parsed_types = array( 'application/x-www-form-urlencoded',