From 0ff6775e55e6ede15bfdb9d7ef28e92212e56561 Mon Sep 17 00:00:00 2001 From: hartvig Date: Thu, 18 Aug 2011 07:38:58 -0200 Subject: [PATCH 1/3] Fixes "CSS path does not change when umbracoCssDirectory is added in web.config" Work items: 30417 --- .../stylesheet/editstylesheet.aspx.cs | 2 +- umbraco/presentation/web.config | 458 +++++++++--------- 2 files changed, 217 insertions(+), 243 deletions(-) diff --git a/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs b/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs index 9c7f4993a0..9388593bac 100644 --- a/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs +++ b/umbraco/presentation/umbraco/settings/stylesheet/editstylesheet.aspx.cs @@ -51,7 +51,7 @@ namespace umbraco.cms.presentation.settings.stylesheet if (appPath == "/") appPath = ""; lttPath.Text = "" + appPath + - "/css/" + stylesheet.Text + ".css"; + IO.SystemDirectories.Css + "/" + stylesheet.Text + ".css"; if (!IsPostBack) diff --git a/umbraco/presentation/web.config b/umbraco/presentation/web.config index 6bccc8deed..fb8ab413ed 100644 --- a/umbraco/presentation/web.config +++ b/umbraco/presentation/web.config @@ -1,16 +1,15 @@ - + - -
- - - - - -
- - -
-
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file From 96cbe17ea9a232a66fdc61cbc9d4a2ff904183e5 Mon Sep 17 00:00:00 2001 From: hartvig Date: Thu, 18 Aug 2011 13:17:59 -0200 Subject: [PATCH 2/3] Work items: 30418 --- umbraco/presentation/page.cs | 5 +- umbraco/presentation/template.cs | 246 +++++++++++++++++++++---------- 2 files changed, 169 insertions(+), 82 deletions(-) diff --git a/umbraco/presentation/page.cs b/umbraco/presentation/page.cs index 03049d4efa..a81d093e46 100644 --- a/umbraco/presentation/page.cs +++ b/umbraco/presentation/page.cs @@ -196,17 +196,16 @@ namespace umbraco { } - HttpContext.Current.Trace.Write("umbracoPage", "testing altTemplate"); // Check for alternative template if (HttpContext.Current.Items["altTemplate"] != null && - HttpContext.Current.Items["altTemplate"].ToString() != "") + HttpContext.Current.Items["altTemplate"].ToString() != String.Empty) { template = umbraco.cms.businesslogic.template.Template.GetTemplateIdFromAlias( HttpContext.Current.Items["altTemplate"].ToString()); elements.Add("template", template.ToString()); } - else if (helper.Request("altTemplate") != "") + else if (helper.Request("altTemplate") != String.Empty) { template = umbraco.cms.businesslogic.template.Template.GetTemplateIdFromAlias(helper.Request("altTemplate").ToLower()); diff --git a/umbraco/presentation/template.cs b/umbraco/presentation/template.cs index fae1845b98..43fd7ffb10 100644 --- a/umbraco/presentation/template.cs +++ b/umbraco/presentation/template.cs @@ -15,12 +15,14 @@ using umbraco.BusinessLogic; using umbraco.IO; using System.Web; -namespace umbraco { +namespace umbraco +{ /// /// Holds methods for parsing and building umbraco templates /// /// - public class template { + public class template + { #region private variables StringBuilder templateOutput = new StringBuilder(); @@ -34,32 +36,38 @@ namespace umbraco { #endregion #region public properties - public String TemplateContent { - set { + public String TemplateContent + { + set + { templateOutput.Append(value); } - get { + get + { return templateOutput.ToString(); } } - public int MasterTemplate { + public int MasterTemplate + { get { return _masterTemplate; } } //added fallback to the default template to avoid nasty .net errors. //This is referenced in /default.aspx.cs during page rendering. - public string MasterPageFile { - get { + public string MasterPageFile + { + get + { string file = TemplateAlias.Replace(" ", "") + ".master"; string path = SystemDirectories.Masterpages + "/" + file; - if (System.IO.File.Exists(IOHelper.MapPath( VirtualPathUtility.ToAbsolute( path ) ))) + if (System.IO.File.Exists(IOHelper.MapPath(VirtualPathUtility.ToAbsolute(path)))) return path; else - return SystemDirectories.Umbraco + "/masterPages/default.master"; + return SystemDirectories.Umbraco + "/masterPages/default.master"; } } @@ -71,7 +79,8 @@ namespace umbraco { string path = SystemDirectories.Masterpages + "/" + templateFolder + "/" + file; //if it doesn't exists then we return the normal file - if (!System.IO.File.Exists(IOHelper.MapPath(VirtualPathUtility.ToAbsolute(path)))){ + if (!System.IO.File.Exists(IOHelper.MapPath(VirtualPathUtility.ToAbsolute(path)))) + { string originalPath = IOHelper.MapPath(VirtualPathUtility.ToAbsolute(MasterPageFile)); string copyPath = IOHelper.MapPath(VirtualPathUtility.ToAbsolute(path)); @@ -90,24 +99,27 @@ namespace umbraco { replacement.Write(newfile); replacement.Close(); } - + return path; - + } - public string TemplateAlias { + public string TemplateAlias + { get { return _templateAlias; } } #endregion #region public methods - public override string ToString() { + public override string ToString() + { return this._templateName; } - public Control ParseWithControls(page umbPage) { + public Control ParseWithControls(page umbPage) + { System.Web.HttpContext.Current.Trace.Write("umbracoTemplate", "Start parsing"); if (System.Web.HttpContext.Current.Items["macrosAdded"] == null) @@ -124,7 +136,8 @@ namespace umbraco { // Find header and footer of page if there is an aspnet-form on page if (templateOutput.ToString().ToLower().IndexOf("") > 0 || - templateOutput.ToString().ToLower().IndexOf("") > 0) { + templateOutput.ToString().ToLower().IndexOf("") > 0) + { pageForm.Attributes.Add("method", "post"); pageForm.Attributes.Add("action", Convert.ToString(System.Web.HttpContext.Current.Items["VirtualUrl"])); @@ -134,11 +147,14 @@ namespace umbraco { int aspnetFormTagEnd = tempOutput.ToString().ToLower().IndexOf("") + 15; // check if we should disable the script manager - if (aspnetFormTagBegin == -1) { + if (aspnetFormTagBegin == -1) + { aspnetFormTagBegin = templateOutput.ToString().ToLower().IndexOf(""); aspnetFormTagLength = 42; - } else { + } + else + { ScriptManager sm = new ScriptManager(); sm.ID = "umbracoScriptManager"; pageForm.Controls.Add(sm); @@ -148,7 +164,8 @@ namespace umbraco { StringBuilder header = new StringBuilder(tempOutput.ToString().Substring(0, aspnetFormTagBegin)); // Check if there's an asp.net head element in the header - if (header.ToString().ToLower().Contains("")) { + if (header.ToString().ToLower().Contains("")) + { StringBuilder beforeHeader = new StringBuilder(header.ToString().Substring(0, header.ToString().ToLower().IndexOf(""))); header.Remove(0, header.ToString().ToLower().IndexOf("") + 14); StringBuilder afterHeader = new StringBuilder(header.ToString().Substring(header.ToString().ToLower().IndexOf("") + 15, header.Length - header.ToString().ToLower().IndexOf("") - 15)); @@ -156,7 +173,8 @@ namespace umbraco { // Find the title from head MatchCollection matches = Regex.Matches(header.ToString(), @"(.*?)", RegexOptions.IgnoreCase | RegexOptions.Multiline); - if (matches.Count > 0) { + if (matches.Count > 0) + { StringBuilder titleText = new StringBuilder(); HtmlTextWriter titleTextTw = new HtmlTextWriter(new System.IO.StringWriter(titleText)); parseStringBuilder(new StringBuilder(matches[0].Groups[1].Value), umbPage).RenderControl(titleTextTw); @@ -172,7 +190,8 @@ namespace umbraco { pageHeader.Controls.Add(pageAspNetHead); pageHeader.Controls.Add(parseStringBuilder(afterHeader, umbPage)); - } else + } + else pageHeader.Controls.Add(parseStringBuilder(header, umbPage)); @@ -190,22 +209,26 @@ namespace umbraco { pageContent.Controls.Add(pageFooter); return pageContent; - } else + } + else return parseStringBuilder(tempOutput, umbPage); } - public Control parseStringBuilder(StringBuilder tempOutput, page umbPage) { + public Control parseStringBuilder(StringBuilder tempOutput, page umbPage) + { Control pageContent = new Control(); bool stop = false; bool debugMode = umbraco.presentation.UmbracoContext.Current.Request.IsDebug; - - while (!stop) { + + while (!stop) + { System.Web.HttpContext.Current.Trace.Write("template", "Begining of parsing rutine..."); int tagIndex = tempOutput.ToString().ToLower().IndexOf(" -1) { + if (tagIndex > -1) + { String tempElementContent = ""; pageContent.Controls.Add(new LiteralControl(tempOutput.ToString().Substring(0, tagIndex))); @@ -215,13 +238,15 @@ namespace umbraco { Hashtable attributes = helper.ReturnAttributes(tag); // Check whether it's a single tag () or a tag with children (...) - if (tag.Substring(tag.Length - 2, 1) != "/" && tag.IndexOf(" ") > -1) { + if (tag.Substring(tag.Length - 2, 1) != "/" && tag.IndexOf(" ") > -1) + { String closingTag = ""; // Tag with children are only used when a macro is inserted by the umbraco-editor, in the // following format: "", so we // need to delete extra information inserted which is the image-tag and the closing // umbraco_macro tag - if (tempOutput.ToString().IndexOf(closingTag) > -1) { + if (tempOutput.ToString().IndexOf(closingTag) > -1) + { tempOutput.Remove(0, tempOutput.ToString().IndexOf(closingTag)); } } @@ -231,12 +256,14 @@ namespace umbraco { System.Web.HttpContext.Current.Trace.Write("umbTemplate", "Outputting item: " + tag); // Handle umbraco macro tags - if (tag.ToString().ToLower().IndexOf("umbraco_macro") > -1) { + if (tag.ToString().ToLower().IndexOf("umbraco_macro") > -1) + { if (debugMode) pageContent.Controls.Add(new LiteralControl("
")); // NH: Switching to custom controls for macros - if (UmbracoSettings.UseAspNetMasterPages) { + if (UmbracoSettings.UseAspNetMasterPages) + { umbraco.presentation.templateControls.Macro macroControl = new umbraco.presentation.templateControls.Macro(); macroControl.Alias = helper.FindAttribute(attributes, "macroalias"); IDictionaryEnumerator ide = attributes.GetEnumerator(); @@ -244,7 +271,9 @@ namespace umbraco { if (macroControl.Attributes[ide.Key.ToString()] == null) macroControl.Attributes.Add(ide.Key.ToString(), ide.Value.ToString()); pageContent.Controls.Add(macroControl); - } else { + } + else + { macro tempMacro; String macroID = helper.FindAttribute(attributes, "macroid"); if (macroID != String.Empty) @@ -252,27 +281,35 @@ namespace umbraco { else tempMacro = macro.ReturnFromAlias(helper.FindAttribute(attributes, "macroalias")); - if (tempMacro != null) { + if (tempMacro != null) + { - try { + try + { Control c = tempMacro.renderMacro(attributes, umbPage.Elements, umbPage.PageID); if (c != null) pageContent.Controls.Add(c); else System.Web.HttpContext.Current.Trace.Warn("Template", "Result of macro " + tempMacro.Name + " is null"); - } catch (Exception e) { + } + catch (Exception e) + { System.Web.HttpContext.Current.Trace.Warn("Template", "Error adding macro " + tempMacro.Name, e); } } } if (debugMode) pageContent.Controls.Add(new LiteralControl("
")); - } else { - if (tag.ToLower().IndexOf("umbraco_getitem") > -1) { + } + else + { + if (tag.ToLower().IndexOf("umbraco_getitem") > -1) + { // NH: Switching to custom controls for items - if (UmbracoSettings.UseAspNetMasterPages) { + if (UmbracoSettings.UseAspNetMasterPages) + { umbraco.presentation.templateControls.Item itemControl = new umbraco.presentation.templateControls.Item(); itemControl.Field = helper.FindAttribute(attributes, "field"); IDictionaryEnumerator ide = attributes.GetEnumerator(); @@ -280,23 +317,32 @@ namespace umbraco { if (itemControl.Attributes[ide.Key.ToString()] == null) itemControl.Attributes.Add(ide.Key.ToString(), ide.Value.ToString()); pageContent.Controls.Add(itemControl); - } else { - try { - if (helper.FindAttribute(attributes, "nodeId") != "" && int.Parse(helper.FindAttribute(attributes, "nodeId")) != 0) { + } + else + { + try + { + if (helper.FindAttribute(attributes, "nodeId") != "" && int.Parse(helper.FindAttribute(attributes, "nodeId")) != 0) + { cms.businesslogic.Content c = new umbraco.cms.businesslogic.Content(int.Parse(helper.FindAttribute(attributes, "nodeId"))); item umbItem = new item(c.getProperty(helper.FindAttribute(attributes, "field")).Value.ToString(), attributes); tempElementContent = umbItem.FieldContent; // Check if the content is published - if (c.nodeObjectType == cms.businesslogic.web.Document._objectType) { - try { + if (c.nodeObjectType == cms.businesslogic.web.Document._objectType) + { + try + { cms.businesslogic.web.Document d = (cms.businesslogic.web.Document)c; if (!d.Published) tempElementContent = ""; - } catch { } + } + catch { } } - } else { + } + else + { // NH adds Live Editing test stuff item umbItem = new item(umbPage.Elements, attributes); // item umbItem = new item(umbPage.PageElements[helper.FindAttribute(attributes, "field")].ToString(), attributes); @@ -306,7 +352,9 @@ namespace umbraco { if (debugMode) tempElementContent = "
" + tempElementContent + "
"; - } catch (Exception e) { + } + catch (Exception e) + { System.Web.HttpContext.Current.Trace.Warn("umbracoTemplate", "Error reading element (" + helper.FindAttribute(attributes, "field") + ")", e); } } @@ -314,7 +362,9 @@ namespace umbraco { } tempOutput.Remove(0, tempOutput.ToString().IndexOf(">") + 1); tempOutput.Insert(0, tempElementContent); - } else { + } + else + { pageContent.Controls.Add(new LiteralControl(tempOutput.ToString())); break; } @@ -345,7 +395,8 @@ namespace umbraco { /// Replaces the found tags in the StringBuilder object, with "real content" /// /// - public void Parse(page umbPage) { + public void Parse(page umbPage) + { System.Web.HttpContext.Current.Trace.Write("umbracoTemplate", "Start parsing"); // First parse for known umbraco tags @@ -353,25 +404,34 @@ namespace umbraco { // - print item from page, level, or recursive MatchCollection tags = Regex.Matches(templateOutput.ToString(), "<\\?UMBRACO_MACRO[^>]*/>|<\\?UMBRACO_GETITEM[^>]*/>|<\\?(?[\\S]*)[^>]*/>", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); - foreach (Match tag in tags) { + foreach (Match tag in tags) + { Hashtable attributes = helper.ReturnAttributes(tag.Value.ToString()); - if (tag.ToString().ToLower().IndexOf("umbraco_macro") > -1) { + if (tag.ToString().ToLower().IndexOf("umbraco_macro") > -1) + { String macroID = helper.FindAttribute(attributes, "macroid"); - if (macroID != "") { + if (macroID != "") + { macro tempMacro = getMacro(macroID); templateOutput.Replace(tag.Value.ToString(), tempMacro.MacroContent.ToString()); } - } else { - if (tag.ToString().ToLower().IndexOf("umbraco_getitem") > -1) { - try { + } + else + { + if (tag.ToString().ToLower().IndexOf("umbraco_getitem") > -1) + { + try + { String tempElementContent = umbPage.Elements[helper.FindAttribute(attributes, "field")].ToString(); MatchCollection tempMacros = Regex.Matches(tempElementContent, "<\\?UMBRACO_MACRO(?[^>]*)>]*><\\/\\?UMBRACO_MACRO>", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); - foreach (Match tempMacro in tempMacros) { + foreach (Match tempMacro in tempMacros) + { Hashtable tempAttributes = helper.ReturnAttributes(tempMacro.Groups["attributes"].Value.ToString()); String macroID = helper.FindAttribute(tempAttributes, "macroid"); - if (Convert.ToInt32(macroID) > 0) { + if (Convert.ToInt32(macroID) > 0) + { macro tempContentMacro = getMacro(macroID); templateOutput.Replace(tag.Value.ToString(), tempContentMacro.MacroContent.ToString()); } @@ -379,7 +439,9 @@ namespace umbraco { } templateOutput.Replace(tag.Value.ToString(), tempElementContent); - } catch (Exception e) { + } + catch (Exception e) + { System.Web.HttpContext.Current.Trace.Warn("umbracoTemplate", "Error reading element (" + helper.FindAttribute(attributes, "field") + ")", e); } } @@ -395,12 +457,14 @@ namespace umbraco { #region private methods - private macro getMacro(String macroID) { + private macro getMacro(String macroID) + { System.Web.HttpContext.Current.Trace.Write("umbracoTemplate", "Starting macro (" + macroID.ToString() + ")"); return new macro(Convert.ToInt16(macroID)); } - private String FindAttribute(Hashtable attributes, String key) { + private String FindAttribute(Hashtable attributes, String key) + { if (attributes[key] != null) return attributes[key].ToString(); else @@ -410,7 +474,8 @@ namespace umbraco { #endregion - protected static ISqlHelper SqlHelper { + protected static ISqlHelper SqlHelper + { get { return Application.SqlHelper; } } @@ -421,7 +486,8 @@ namespace umbraco { return GetMasterPageName(templateID, null); } - public static string GetMasterPageName(int templateID, string templateFolder) { + public static string GetMasterPageName(int templateID, string templateFolder) + { template t = (template)templateCache["template" + templateID]; if (t == null) t = new template(templateID); @@ -435,17 +501,23 @@ namespace umbraco { throw new ArgumentException(String.Format("Template with id '{0}' not found", templateID)); } - public template(int templateID) { - if (templateCache["template" + templateID.ToString()] != null) { + public template(int templateID) + { + if (templateCache["template" + templateID.ToString()] != null) + { template t = (template)templateCache["template" + templateID]; this._masterTemplate = t._masterTemplate; this._templateAlias = t._templateAlias; this._templateDesign = t._templateDesign; this._masterTemplate = t._masterTemplate; this._templateName = t._templateName; - } else { - using (IRecordsReader templateData = SqlHelper.ExecuteReader("select nodeId, alias, master, text, design from cmsTemplate inner join umbracoNode node on node.id = cmsTemplate.nodeId where nodeId = @templateID", SqlHelper.CreateParameter("@templateID", templateID))) { - if (templateData.Read()) { + } + else + { + using (IRecordsReader templateData = SqlHelper.ExecuteReader("select nodeId, alias, master, text, design from cmsTemplate inner join umbracoNode node on node.id = cmsTemplate.nodeId where nodeId = @templateID", SqlHelper.CreateParameter("@templateID", templateID))) + { + if (templateData.Read()) + { // Get template master and replace content where the template if (!templateData.IsNull("master")) _masterTemplate = templateData.GetInt("master"); @@ -477,17 +549,24 @@ namespace umbraco { templateOutput.Append(_templateDesign); } else { if (_masterTemplate == templateID) - System.Web.HttpContext.Current.Trace.Warn("template", "Master template is the same as the current template. It would course an endless loop!"); - templateOutput.Append(_templateDesign); + { + cms.businesslogic.template.Template t = cms.businesslogic.template.Template.GetTemplate(templateID); + string templateName = (t != null) ? t.Text : string.Format("'Template with id: '{0}", templateID); + System.Web.HttpContext.Current.Trace.Warn("template", + String.Format("Master template is the same as the current template. It would cause an endless loop! Make sure that the current template '{0}' has another Master Template than itself. You can change this in the template editor under 'Settings'", templateName)); + templateOutput.Append(_templateDesign); + } } } - public static void ClearCachedTemplate(int templateID) { + public static void ClearCachedTemplate(int templateID) + { if (templateCache["template" + templateID.ToString()] != null) templateCache.Remove("template" + templateID.ToString()); } - public template(String templateContent) { + public template(String templateContent) + { templateOutput.Append(templateContent); _masterTemplate = 0; } @@ -495,37 +574,46 @@ namespace umbraco { #endregion } - public class templateCacheRefresh : interfaces.ICacheRefresher { + public class templateCacheRefresh : interfaces.ICacheRefresher + { #region ICacheRefresher Members - public string Name { - get { + public string Name + { + get + { // TODO: Add templateCacheRefresh.Name getter implementation return "Template cache refresher"; } } - public Guid UniqueIdentifier { - get { + public Guid UniqueIdentifier + { + get + { // TODO: Add templateCacheRefresh.UniqueIdentifier getter implementation return new Guid("DD12B6A0-14B9-46e8-8800-C154F74047C8"); } } - public void RefreshAll() { + public void RefreshAll() + { // Doesn't do anything } - public void Refresh(Guid Id) { + public void Refresh(Guid Id) + { // Doesn't do anything } - void umbraco.interfaces.ICacheRefresher.Refresh(int Id) { + void umbraco.interfaces.ICacheRefresher.Refresh(int Id) + { template.ClearCachedTemplate(Id); } //PPH remove tamplete from cache - public void Remove(int Id) { + public void Remove(int Id) + { template.ClearCachedTemplate(Id); From 2ba2c0fd612410a8e86c3a74c6eadb7160fd23b6 Mon Sep 17 00:00:00 2001 From: hartvig Date: Thu, 18 Aug 2011 13:24:55 -0200 Subject: [PATCH 3/3] Work items: 30410 --- .../config/umbracoSettings.config | 2 ++ umbraco/businesslogic/UmbracoSettings.cs | 22 +++++++++++++++++++ umbraco/presentation/default.aspx.cs | 3 ++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/config templates/config/umbracoSettings.config b/config templates/config/umbracoSettings.config index 7939ac1b70..c5371c0ddc 100644 --- a/config templates/config/umbracoSettings.config +++ b/config templates/config/umbracoSettings.config @@ -103,6 +103,8 @@ ae oe + + true diff --git a/umbraco/businesslogic/UmbracoSettings.cs b/umbraco/businesslogic/UmbracoSettings.cs index d9f8d0be75..348632bd30 100644 --- a/umbraco/businesslogic/UmbracoSettings.cs +++ b/umbraco/businesslogic/UmbracoSettings.cs @@ -280,6 +280,28 @@ namespace umbraco } } + /// + /// Gets a value indicating whether umbraco shouldn't add X-Umbraco-Version to the http header. + /// + /// true if umbraco will not add header; otherwise, false. + public static bool RemoveUmbracoVersionHeader + { + get + { + try + { + bool result; + if (bool.TryParse(GetKey("/settings/requestHandler/removeUmbracoVersionHeader"), out result)) + return result; + return false; + } + catch + { + return false; + } + } + } + /// /// This will add a trailing slash (/) to urls when in directory url mode /// NOTICE: This will always return false if Directory Urls in not active diff --git a/umbraco/presentation/default.aspx.cs b/umbraco/presentation/default.aspx.cs index dd70c09918..53b4b19dc1 100644 --- a/umbraco/presentation/default.aspx.cs +++ b/umbraco/presentation/default.aspx.cs @@ -208,7 +208,8 @@ namespace umbraco base.OnInit(e); // Add Umbraco header - Response.AddHeader("X-Umbraco-Version", string.Format("{0}.{1}", GlobalSettings.VersionMajor, GlobalSettings.VersionMinor)); + if (!UmbracoSettings.RemoveUmbracoVersionHeader) + Response.AddHeader("X-Umbraco-Version", string.Format("{0}.{1}", GlobalSettings.VersionMajor, GlobalSettings.VersionMinor)); } private void initUmbracoPage()