Merge branch origin/dev-v7 into temp8

This commit is contained in:
Stephan
2018-09-06 13:07:09 +02:00
76 changed files with 1607 additions and 130 deletions

View File

@@ -30,6 +30,8 @@ namespace Umbraco.Web.Trees
[HttpQueryStringFilter("queryStrings")]
public async Task<SectionRootNode> GetApplicationTrees(string application, string tree, FormDataCollection queryStrings, bool onlyInitialized = true)
{
application = application.CleanForXss();
if (string.IsNullOrEmpty(application)) throw new HttpResponseException(HttpStatusCode.NotFound);
var rootId = Constants.System.Root.ToString(CultureInfo.InvariantCulture);
@@ -37,7 +39,7 @@ namespace Umbraco.Web.Trees
//find all tree definitions that have the current application alias
var appTrees = Services.ApplicationTreeService.GetApplicationTrees(application, onlyInitialized).ToArray();
if (appTrees.Length == 1 || string.IsNullOrEmpty(tree) == false )
if (string.IsNullOrEmpty(tree) == false || appTrees.Length <= 1)
{
var apptree = string.IsNullOrEmpty(tree) == false
? appTrees.SingleOrDefault(x => x.Alias == tree)