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
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 ] : '' ,
Original file line number Diff line number Diff 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 ' :
Original file line number Diff line number Diff 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 );
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments