File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed
src/BootstrapBlazor.Server/Components Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ private async Task SetCulture(SelectedItem item)
6868 if ( SelectedCulture != item . Value )
6969 {
7070 var culture = item . Value ;
71- var uri = new Uri ( NavigationManager . Uri ) . GetComponents ( UriComponents . PathAndQuery , UriFormat . Unescaped ) ;
71+ var uri = new Uri ( NavigationManager . Uri ) . GetComponents ( UriComponents . PathAndQuery , UriFormat . SafeUnescaped ) ;
7272 var query = $ "?culture={ Uri . EscapeDataString ( culture ) } &redirectUri={ Uri . EscapeDataString ( uri ) } ";
7373
7474 // use a path that matches your culture redirect controller from the previous steps
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ private Task SetLang(string cultureName)
9696 // 使用 api 方式 适用于 Server-Side 模式
9797 if ( SelectedCulture != cultureName )
9898 {
99- var uri = new Uri ( NavigationManager . Uri ) . GetComponents ( UriComponents . PathAndQuery , UriFormat . Unescaped ) ;
99+ var uri = new Uri ( NavigationManager . Uri ) . GetComponents ( UriComponents . PathAndQuery , UriFormat . SafeUnescaped ) ;
100100 var query = $ "?culture={ Uri . EscapeDataString ( cultureName ) } &redirectUri={ Uri . EscapeDataString ( uri ) } ";
101101
102102 // use a path that matches your culture redirect controller from the previous steps
Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ public class CultureController : Controller
184184 if (SelectedCulture != item .Value )
185185 {
186186 var culture = item .Value ;
187- var uri = new Uri (NavigationManager .Uri ).GetComponents (UriComponents .PathAndQuery , UriFormat .Unescaped );
187+ var uri = new Uri (NavigationManager .Uri ).GetComponents (UriComponents .PathAndQuery , UriFormat .SafeUnescaped );
188188 var query = $" ?culture={Uri .EscapeDataString (culture )}&redirectUri={Uri .EscapeDataString (uri )}" ;
189189
190190 // use a path that matches your culture redirect controller from the previous steps
You can’t perform that action at this time.
0 commit comments