/** * @return string */ protected function _getUrl() { $refererUrl = $this->_request->getServer('HTTP_REFERER'); $url = (string) $this->_request->getParam(self::PARAM_NAME_REFERER_URL); if ($url) { $refererUrl = $url; } $url = $this->_request->getParam(\Magento\Framework\App\Action\Action::PARAM_NAME_BASE64_URL); if ($url) { $refererUrl = $this->_urlCoder->decode($url); } $url = $this->_request->getParam(\Magento\Framework\App\Action\Action::PARAM_NAME_URL_ENCODED); if ($url) { $refererUrl = $this->_urlCoder->decode($url); } if (!$this->_isUrlInternal($refererUrl)) { $refererUrl = $this->_storeManager->getStore()->getBaseUrl(); } return $refererUrl; }
/** * Get URL to download CSS file * * @param string $fileId * @param int $themeId * @return string */ public function getDownloadUrl($fileId, $themeId) { return $this->getUrl('adminhtml/*/downloadCss', array('theme_id' => $themeId, 'file' => $this->urlCoder->encode($fileId))); }
public function testEncode() { $this->assertEquals($this->_encodeUrl, $this->_urlCoder->encode($this->_url)); }