Skip to content

Commit a0ac45f

Browse files
committed
Fixes after code review
1 parent e376f10 commit a0ac45f

File tree

2 files changed

+5
-8
lines changed
  • app/code/Magento/Widget/Controller/Adminhtml/Widget
  • lib/internal/Magento/Framework/Url

2 files changed

+5
-8
lines changed

app/code/Magento/Widget/Controller/Adminhtml/Widget/Index.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22
/**
3-
*
43
* Copyright © Magento, Inc. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
@@ -13,11 +12,9 @@ class Index extends \Magento\Backend\App\Action implements HttpPostActionInterfa
1312
/**
1413
* Authorization level of a basic admin session
1514
*/
16-
const ADMIN_RESOURCE = 'Magento_Widget::widget_instance';
15+
public const ADMIN_RESOURCE = 'Magento_Widget::widget_instance';
1716

1817
/**
19-
* Core registry
20-
*
2118
* @var \Magento\Framework\Registry
2219
*/
2320
protected $_coreRegistry;
@@ -50,11 +47,11 @@ public function __construct(
5047
public function execute()
5148
{
5249
// save extra params for widgets insertion form
53-
$skipped = $this->getRequest()->getParam('skip_widgets');
50+
$skipped = $this->getRequest()->getParam('skip_widgets', '');
5451
$skipped = $this->_widgetConfig->decodeWidgetsFromQuery($skipped);
55-
5652
$this->_coreRegistry->register('skip_widgets', $skipped);
5753

54+
// phpcs:ignore Magento2.Legacy.ObsoleteResponse
5855
$this->_view->loadLayout('empty')->renderLayout();
5956
}
6057
}

lib/internal/Magento/Framework/Url/Decoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ public function __construct(
2424
}
2525

2626
/**
27-
* Base64 decode for URL
27+
* base64_decode() for URLs decoding
2828
*
2929
* @param string $url
3030
* @return string
3131
*/
3232
public function decode($url)
3333
{
34-
$url = $url !== null ? base64_decode(strtr($url, '-_,', '+/=')) : '';
34+
$url = base64_decode(strtr($url, '-_,', '+/='));
3535
return $this->urlBuilder->sessionUrlVar($url);
3636
}
3737
}

0 commit comments

Comments
 (0)