Skip to content
Snippets Groups Projects
Commit a3349913 authored by Bohdan Korablov's avatar Bohdan Korablov
Browse files

MAGETWO-56317: [GitHub] -[2.1.0] underscore in site url breaks admin redirect...

MAGETWO-56317: [GitHub] -[2.1.0] underscore in site url breaks admin redirect - The page isn't redirecting properly #5809
parent ee431f1f
Branches
No related merge requests found
......@@ -227,6 +227,7 @@ class Baseurl extends \Magento\Framework\App\Config\Value
*
* @param string $value
* @return bool
* @throws \Magento\Framework\Exception\LocalizedException
*/
private function _isFullyQualifiedUrl($value)
{
......
......@@ -21,18 +21,19 @@ class UrlCheck extends AbstractActionController
$params = Json::decode($this->getRequest()->getContent(), Json::TYPE_ARRAY);
$result = ['successUrl' => false, 'successSecureUrl' => true];
$hasBaseUrl = isset($params['address']['actual_base_url']);
$hasSecureBaseUrl = isset($params['https']['text']);
$hasSecureAdminUrl = !empty($params['https']['admin']);
$hasSecureFrontUrl = !empty($params['https']['front']);
// Validating of Base URL
if (isset($params['address']['actual_base_url'])
&& filter_var($params['address']['actual_base_url'], FILTER_VALIDATE_URL)
) {
if ($hasBaseUrl && filter_var($params['address']['actual_base_url'], FILTER_VALIDATE_URL)) {
$result['successUrl'] = true;
}
// Validating of Secure Base URL
if (!empty($params['https']['admin']) || !empty($params['https']['front'])) {
if (!(isset($params['https']['text'])
&& filter_var($params['https']['text'], FILTER_VALIDATE_URL))
) {
if ($hasSecureAdminUrl || $hasSecureFrontUrl) {
if (!($hasSecureBaseUrl && filter_var($params['https']['text'], FILTER_VALIDATE_URL))) {
$result['successSecureUrl'] = false;
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment