Skip to content

Commit 53f188b

Browse files
committed
fixes after CR
1 parent 422a871 commit 53f188b

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

app/code/Magento/Backend/App/DefaultPath.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ class DefaultPath implements \Magento\Framework\App\DefaultPathInterface
2424
*/
2525
public function __construct(\Magento\Backend\App\ConfigInterface $config)
2626
{
27-
$path = $config->getValue('web/default/admin');
28-
$pathParts = $path ? explode('/', $path) : [''];
27+
$pathConfigValue = $config->getValue('web/default/admin') ?? '';
28+
$pathParts = [];
29+
if ($pathConfigValue) {
30+
$pathParts = explode('/', $pathConfigValue);
31+
}
2932

3033
$this->_parts = [
3134
'area' => isset($pathParts[0]) ? $pathParts[0] : '',

app/code/Magento/Backend/view/adminhtml/templates/widget/tabshoriz.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use Magento\Framework\View\Helper\SecureHtmlRenderer;
1919
<?php foreach ($tabs as $_tab): ?>
2020
<?php $tabId = $block->getTabId($_tab) ?>
2121
<?php $_tabClass = 'tab-item-link ' . $block->getTabClass($_tab) . ' ' .
22-
(preg_match('/\s?ajax\s?/', $_tab->getClass() ?? '') ? 'notloaded' : '') ?>
22+
($_tab->getClass() !== null ? (preg_match('/\s?ajax\s?/', $_tab->getClass()) ? 'notloaded' : '') : '') ?>
2323
<?php $_tabType = (!preg_match('/\s?ajax\s?/', $_tabClass) && $block->getTabUrl($_tab) != '#') ? 'link' : '' ?>
2424
<?php $_tabHref = $block->getTabUrl($_tab) == '#' ?
2525
'#' . $tabId . '_content' :

lib/internal/Magento/Framework/Filesystem/Driver/File.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,10 @@ public function getRealPath($path)
10601060
*/
10611061
public function getRealPathSafety($path)
10621062
{
1063+
if ($path === null) {
1064+
return '';
1065+
}
1066+
10631067
//Check backslashes
10641068
$path = preg_replace(
10651069
'/\\\\+/',
@@ -1074,8 +1078,8 @@ public function getRealPathSafety($path)
10741078
$path
10751079
);
10761080

1077-
if (!$path || strpos($path, DIRECTORY_SEPARATOR . '.') === false) {
1078-
return $path ? rtrim($path, DIRECTORY_SEPARATOR) : '';
1081+
if (strpos($path, DIRECTORY_SEPARATOR . '.') === false) {
1082+
return rtrim($path, DIRECTORY_SEPARATOR);
10791083
}
10801084

10811085
$pathParts = explode(DIRECTORY_SEPARATOR, $path);

lib/internal/Magento/Framework/Url.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,14 @@ protected function _setRoutePath($data)
504504
}
505505

506506
$this->unsetData('route_path');
507-
$routePieces = $data ? explode('/', $data) : [''];
508-
509-
$route = array_shift($routePieces);
510-
if ('*' === $route) {
511-
$route = $this->_getRequest()->getRouteName();
507+
$route = '';
508+
$routePieces = [];
509+
if (!empty($data)) {
510+
$routePieces = explode('/', $data);
511+
$route = array_shift($routePieces);
512+
if ('*' === $route) {
513+
$route = $this->_getRequest()->getRouteName();
514+
}
512515
}
513516
$this->_setRouteName($route);
514517

0 commit comments

Comments
 (0)