Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

[hotfix/ZF-11776] Zend_Amf #571

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion library/Zend/Amf/Response/HttpResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,33 @@ public function getResponse()
{
if (!headers_sent()) {
header('Cache-Control: no-cache, must-revalidate');
if($this->isIeOverSsl()) {
header('Cache-Control: cache, must-revalidate');
header('Pragma: public');
} else {
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
}
header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');
header('Pragma: no-cache');
header('Content-Type: application/x-amf');
}
return parent::getResponse();
}

protected function isIeOverSsl()
{
$ssl = $_SERVER['HTTPS'];
if (!$ssl || ($ssl == 'off')) {
// IIS reports "off", whereas other browsers simply don't populate
return false;
}

$ua = $_SERVER['HTTP_USER_AGENT'];
if (!preg_match('/; MSIE \d+\.\d+;/', $ua)) {
// Not MicroSoft Internet Explorer
return false;
}

return true;
}
}