00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 class Mage_Core_Controller_Response_Http extends Zend_Controller_Response_Http
00034 {
00035 public function outputBody()
00036 {
00037 Mage::getSingleton('core/translate_inline')->processResponseBody($this->_body);
00038 parent::outputBody();
00039 }
00040
00041
00042
00043
00044
00045
00046
00047 public function sendHeaders()
00048 {
00049 if (!$this->canSendHeaders()) {
00050 Mage::log('HEADERS ALREADY SENT: '.mageDebugBacktrace(true, true, true));
00051 return $this;
00052 }
00053
00054 if (substr(php_sapi_name(), 0, 3) == 'cgi') {
00055 $statusSent = false;
00056 foreach ($this->_headersRaw as $i=>$header) {
00057 if (stripos($header, 'status:')===0) {
00058 if ($statusSent) {
00059 unset($this->_headersRaw[$i]);
00060 } else {
00061 $statusSent = true;
00062 }
00063 }
00064 }
00065 foreach ($this->_headers as $i=>$header) {
00066 if (strcasecmp($header['name'], 'status')===0) {
00067 if ($statusSent) {
00068 unset($this->_headers[$i]);
00069 } else {
00070 $statusSent = true;
00071 }
00072 }
00073 }
00074 }
00075 parent::sendHeaders();
00076 }
00077 }