diff --git a/src/Umbraco.Core/StringExtensions.cs b/src/Umbraco.Core/StringExtensions.cs index eebd7ff1e8..abdae894c4 100644 --- a/src/Umbraco.Core/StringExtensions.cs +++ b/src/Umbraco.Core/StringExtensions.cs @@ -842,7 +842,7 @@ namespace Umbraco.Core /// This allows you to replace strings like & , etc.. with your replacement character before the automatic /// reduction. /// - [UmbracoWillObsolete("This method should be removed. Use ToUrlSegment instead.")] + [Obsolete("This method should be removed. Use ToUrlSegment instead.")] public static string ToUrlAlias(this string value, IDictionary charReplacements, bool replaceDoubleDashes, bool stripNonAscii, bool urlEncode) { var helper = ShortStringHelper; @@ -866,7 +866,7 @@ namespace Umbraco.Core /// and UmbracoSettings.RemoveDoubleDashesFromUrlReplacing. /// Other helpers may use different parameters. /// - [UmbracoWillObsolete("This method should be removed. Use ToUrlSegment instead.")] + [Obsolete("This method should be removed. Use ToUrlSegment instead.")] public static string FormatUrl(this string url) { var helper = ShortStringHelper; @@ -933,7 +933,7 @@ namespace Umbraco.Core /// Indicates whether spaces should be removed. THIS PARAMETER IS IGNORED. /// The safe alias. /// CamelCase, and remove spaces, whatever the parameters. - [UmbracoWillObsolete("This method should be removed. Use ToSafeAlias instead.")] + [Obsolete("This method should be removed. Use ToSafeAlias instead.")] public static string ToUmbracoAlias(this string phrase, StringAliasCaseType caseType = StringAliasCaseType.CamelCase, bool removeSpaces = false) { var helper = ShortStringHelper; @@ -978,7 +978,7 @@ namespace Umbraco.Core /// This is the legacy method, so we can't really change it, although it has issues (see unit tests). /// It does more than "converting the case", and also remove spaces, etc. /// - [UmbracoWillObsolete("This method should be removed. Use CleanString instead.")] + [Obsolete("This method should be removed. Use CleanString instead.")] public static string ConvertCase(this string phrase, StringAliasCaseType cases) { var helper = ShortStringHelper; diff --git a/src/Umbraco.Web.UI/umbraco/Umbraco.aspx.cs b/src/Umbraco.Web.UI/umbraco/Umbraco.aspx.cs index 02b0feee92..1d41199625 100644 --- a/src/Umbraco.Web.UI/umbraco/Umbraco.aspx.cs +++ b/src/Umbraco.Web.UI/umbraco/Umbraco.aspx.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; @@ -6,8 +7,11 @@ using System.Text.RegularExpressions; using System.Web; using System.Web.UI; using Umbraco.Core.IO; +using Umbraco.Core.Logging; +using Umbraco.Core.Strings; using umbraco; using Umbraco.Core; +using umbraco.BusinessLogic; namespace Umbraco.Web.UI.Umbraco { @@ -15,7 +19,36 @@ namespace Umbraco.Web.UI.Umbraco { public string DefaultApp { get; private set; } - protected void Page_Load(object sender, System.EventArgs e) + protected string InitApp + { + get + { + var app = Request.GetCleanedItem("app"); + //validate the app + if (global::umbraco.BusinessLogic.Application.getAll().Any(x => x.alias.InvariantEquals(app)) == false) + { + LogHelper.Warn("A requested app: " + Request.GetItemAsString("app") + " was not found"); + return string.Empty; + } + return app; + } + } + + protected string RightAction + { + get + { + //manually clean the string, we need to allow / and other url chars but ensure to strip any other potential xss chars. + return Request.GetItemAsString("rightAction").StripHtml().ExceptChars(new HashSet("(){}[];:<>\\'\"".ToCharArray())); + } + } + + protected string RightActionId + { + get { return Request.GetCleanedItem("id").ReplaceNonAlphanumericChars('-'); } + } + + protected void Page_Load(object sender, EventArgs e) { var apps = UmbracoUser.Applications.ToList(); bool userHasAccesstodefaultApp = apps.Any(x => x.alias == Constants.Applications.Content); diff --git a/src/Umbraco.Web.UI/umbraco/dashboard.aspx b/src/Umbraco.Web.UI/umbraco/dashboard.aspx index 91a4de4c0d..f931e86efc 100644 --- a/src/Umbraco.Web.UI/umbraco/dashboard.aspx +++ b/src/Umbraco.Web.UI/umbraco/dashboard.aspx @@ -1,4 +1,4 @@ -<%@ Page language="c#" MasterPageFile="masterpages/umbracoPage.Master" Title="dashboard" Codebehind="dashboard.aspx.cs" AutoEventWireup="True" Inherits="umbraco.cms.presentation.dashboard" trace="false" validateRequest="false"%> +<%@ Page language="c#" MasterPageFile="masterpages/umbracoPage.Master" Title="dashboard" AutoEventWireup="True" Inherits="umbraco.cms.presentation.dashboard" trace="false" validateRequest="false"%> <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> diff --git a/src/Umbraco.Web.UI/umbraco/umbraco.aspx b/src/Umbraco.Web.UI/umbraco/umbraco.aspx index 2df8d2a6d3..7229b80853 100644 --- a/src/Umbraco.Web.UI/umbraco/umbraco.aspx +++ b/src/Umbraco.Web.UI/umbraco/umbraco.aspx @@ -159,13 +159,13 @@