From 477c3c9de6c053696d025d415698648da1ba18ed Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Mon, 23 Sep 2013 13:32:55 +1200 Subject: [PATCH] BUG Fix regression introduced in #2356 (method call on non-object) --- control/HTTP.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/control/HTTP.php b/control/HTTP.php index ea6a39724..f477570ed 100644 --- a/control/HTTP.php +++ b/control/HTTP.php @@ -343,11 +343,14 @@ class HTTP { $responseHeaders['Vary'] = 'Cookie, X-Forwarded-Protocol, User-Agent, Accept'; } else { - // Grab header for checking. Unfortunately HTTPRequest uses a mistyped variant. - $contentDisposition = $body->getHeader('Content-disposition'); - if (!$contentDisposition) $contentDisposition = $body->getHeader('Content-Disposition'); + if($body) { + // Grab header for checking. Unfortunately HTTPRequest uses a mistyped variant. + $contentDisposition = $body->getHeader('Content-disposition'); + if (!$contentDisposition) $contentDisposition = $body->getHeader('Content-Disposition'); + } if( + $body && Director::is_https() && strstr($_SERVER["HTTP_USER_AGENT"], 'MSIE')==true && strstr($contentDisposition, 'attachment;')==true