mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-04 14:46:19 +08:00 
			
		
		
		
	Fix #18426: Fix check for route's leading slash in yii\widgets\Menu
				
					
				
			This commit is contained in:
		@ -12,6 +12,7 @@ Yii Framework 2 Change Log
 | 
				
			|||||||
- Enh #18394: Add support for setting `yii\web\Response::$stream` to a callable (brandonkelly)
 | 
					- Enh #18394: Add support for setting `yii\web\Response::$stream` to a callable (brandonkelly)
 | 
				
			||||||
- Bug #18406: Fix PDO exception when committing or rolling back an autocommitted transaction in PHP 8 (brandonkelly)
 | 
					- Bug #18406: Fix PDO exception when committing or rolling back an autocommitted transaction in PHP 8 (brandonkelly)
 | 
				
			||||||
- Bug #18287: Fix the OUTPUT got SQL syntax error if the column name is MSSQL keyword e.g key (darkdef)
 | 
					- Bug #18287: Fix the OUTPUT got SQL syntax error if the column name is MSSQL keyword e.g key (darkdef)
 | 
				
			||||||
 | 
					- Bug #18426: Fix check for route's leading slash in `yii\widgets\Menu` (stevekr)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
2.0.39.3 November 23, 2020
 | 
					2.0.39.3 November 23, 2020
 | 
				
			||||||
 | 
				
			|||||||
@ -306,7 +306,7 @@ class Menu extends Widget
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        if (isset($item['url']) && is_array($item['url']) && isset($item['url'][0])) {
 | 
					        if (isset($item['url']) && is_array($item['url']) && isset($item['url'][0])) {
 | 
				
			||||||
            $route = Yii::getAlias($item['url'][0]);
 | 
					            $route = Yii::getAlias($item['url'][0]);
 | 
				
			||||||
            if ($route[0] !== '/' && Yii::$app->controller) {
 | 
					            if (substr($route, 0, 1) !== '/' && Yii::$app->controller) {
 | 
				
			||||||
                $route = Yii::$app->controller->module->getUniqueId() . '/' . $route;
 | 
					                $route = Yii::$app->controller->module->getUniqueId() . '/' . $route;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (ltrim($route, '/') !== $this->route) {
 | 
					            if (ltrim($route, '/') !== $this->route) {
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user