File tree Expand file tree Collapse file tree 4 files changed +20
-10
lines changed
view/adminhtml/templates/widget
lib/internal/Magento/Framework Expand file tree Collapse file tree 4 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,11 @@ class DefaultPath implements \Magento\Framework\App\DefaultPathInterface
24
24
*/
25
25
public function __construct (\Magento \Backend \App \ConfigInterface $ config )
26
26
{
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
+ }
29
32
30
33
$ this ->_parts = [
31
34
'area ' => isset ($ pathParts [0 ]) ? $ pathParts [0 ] : '' ,
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ use Magento\Framework\View\Helper\SecureHtmlRenderer;
19
19
<?php foreach ($ tabs as $ _tab ): ?>
20
20
<?php $ tabId = $ block ->getTabId ($ _tab ) ?>
21
21
<?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 ' : '' ) : '' ) ?>
23
23
<?php $ _tabType = (!preg_match ('/\s?ajax\s?/ ' , $ _tabClass ) && $ block ->getTabUrl ($ _tab ) != '# ' ) ? 'link ' : '' ?>
24
24
<?php $ _tabHref = $ block ->getTabUrl ($ _tab ) == '# ' ?
25
25
'# ' . $ tabId . '_content ' :
Original file line number Diff line number Diff line change @@ -1060,6 +1060,10 @@ public function getRealPath($path)
1060
1060
*/
1061
1061
public function getRealPathSafety ($ path )
1062
1062
{
1063
+ if ($ path === null ) {
1064
+ return '' ;
1065
+ }
1066
+
1063
1067
//Check backslashes
1064
1068
$ path = preg_replace (
1065
1069
'/ \\\\+/ ' ,
@@ -1074,8 +1078,8 @@ public function getRealPathSafety($path)
1074
1078
$ path
1075
1079
);
1076
1080
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 );
1079
1083
}
1080
1084
1081
1085
$ pathParts = explode (DIRECTORY_SEPARATOR , $ path );
Original file line number Diff line number Diff line change @@ -504,11 +504,14 @@ protected function _setRoutePath($data)
504
504
}
505
505
506
506
$ 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
+ }
512
515
}
513
516
$ this ->_setRouteName ($ route );
514
517
You can’t perform that action at this time.
0 commit comments