簡體   English   中英

SUPEE 6788修補程序Magento之后無法發送標題錯誤

[英]Cannot sent headers error after SUPEE 6788 patch Magento

我在Magento 1.9.1.0上使用模板,並在使用SUPEE 6788進行補丁后,在system.log中遇到以下錯誤:

2016-04-26T00:50:23+00:00 DEBUG (7): Cannot send headers; headers already sent in /usr/share/nginx/html/app/code/community/Ves/Tabs/controllers/IndexController.php, line 140
2016-04-26T00:50:23+00:00 DEBUG (7): HEADERS ALREADY SENT: <pre>[0] /usr/share/nginx/html/app/code/core/Mage/Core/Controller/Response/Http.php:52
[1] /usr/share/nginx/html/lib/Zend/Controller/Response/Abstract.php:771
[2] /usr/share/nginx/html/app/code/core/Mage/Core/Controller/Response/Http.php:84
[3] /usr/share/nginx/html/app/code/core/Mage/Core/Controller/Varien/Front.php:184
[4] /usr/share/nginx/html/app/code/core/Mage/Core/Model/App.php:354
[5] /usr/share/nginx/html/app/Mage.php:684
[6] /usr/share/nginx/html/index.php:87

在第140行的IndexController.php中,我有以下代碼:

echo Mage::helper('core')->jsonEncode( $json );

我認為json的調用方式會導致此錯誤。 我怎樣才能解決這個問題?

提前致謝。

從以上問題中我了解到,您想對數據進行編碼並在程序中的某處使用它。

如果以上是正確的,那么您可以嘗試以下解決方案。

 $this->getResponse()->clearHeaders()->setHeader('content-type', 'application/json', true); $this->getResponse()->setBody(json_encode($json)); 

謝謝

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM