Merge pull request #2186 from anojht/baseurl-themefix

detect if baseurl is set and reset the url !wip
This commit is contained in:
Jamie 2018-04-22 07:59:30 +01:00 committed by GitHub
commit ced7cfa80f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -90,9 +90,19 @@ O:::::::OOO:::::::Om::::m m::::m m::::mb:::::bbbbbb::::::bi::::::i
if (customization.HasPresetTheme)
{
if (!string.IsNullOrEmpty(baseUrl))
{
if (!customization.PresetThemeContent.Contains("/" + baseUrl))
{
var index = customization.PresetThemeContent.IndexOf("/api/");
customization.PresetThemeContent = customization.PresetThemeContent.Insert(index, "/" + baseUrl);
} else
{
var startIndex = customization.PresetThemeContent.IndexOf("href=");
var index = customization.PresetThemeContent.IndexOf("/api/");
customization.PresetThemeContent = customization.PresetThemeContent.Remove(startIndex+6, (index-(startIndex+6)));
index = customization.PresetThemeContent.IndexOf("/api/");
customization.PresetThemeContent = customization.PresetThemeContent.Insert(index, "/" + baseUrl);
}
}
<style>