感谢 Mufaddal 提供参考。我有两种简单的方法来解决这个问题:
方式1:-
您可以覆盖/重写此帮助程序 app\code\core\Mage\Core\Helper\Abstract.php
通过修改以下功能:
public function escapeUrl($data)
{
return htmlspecialchars($data);
}
至
public function escapeUrl($data)
{
return $data;
}
方式2(最好的方式):
重写/覆盖控制器/app/code/core/Mage/Core/Controller/Varien/Action.php
使用以下修改方法:
protected function _getRefererUrl()
{
$refererUrl = $this->getRequest()->getServer(’HTTP_REFERER’);
if ($url = $this->getRequest()->getParam(self::PARAM_NAME_REFERER_URL)) {
$refererUrl = $url;
}
if ($url = $this->getRequest()->getParam(self::PARAM_NAME_BASE64_URL)) {
$refererUrl = Mage::helper(’core’)->urlDecode($url);
}
if ($url = $this->getRequest()->getParam(self::PARAM_NAME_URL_ENCODED)) {
$refererUrl = Mage::helper(’core’)->urlDecode($url);
}
$refererUrl = Mage::helper(’core’)->escapeUrl($refererUrl);
if (!$this->_isUrlInternal($refererUrl)) {
$refererUrl = Mage::app()->getStore()->getBaseUrl();
}
return $refererUrl;
}
至
protected function _getRefererUrl()
{
$refererUrl = $this->getRequest()->getServer(’HTTP_REFERER’);
if ($url = $this->getRequest()->getParam(self::PARAM_NAME_REFERER_URL)) {
$refererUrl = $url;
}
if ($url = $this->getRequest()->getParam(self::PARAM_NAME_BASE64_URL)) {
$refererUrl = Mage::helper(’core’)->urlDecode($url);
}
if ($url = $this->getRequest()->getParam(self::PARAM_NAME_URL_ENCODED)) {
$refererUrl = Mage::helper(’core’)->urlDecode($url);
}
//$refererUrl = Mage::helper(’core’)->escapeUrl($refererUrl);
if (!$this->_isUrlInternal($refererUrl)) {
$refererUrl = Mage::app()->getStore()->getBaseUrl();
}
return $refererUrl;
}