Merge branch 'dev-v7' into 7.3.0

Conflicts:
	src/Umbraco.Tests/Scheduling/BackgroundTaskRunnerTests.cs
	src/Umbraco.Web/PublishedCache/XmlPublishedCache/XmlCacheFilePersister.cs
	src/Umbraco.Web/Scheduling/LogScrubber.cs
	src/Umbraco.Web/Umbraco.Web.csproj
	src/Umbraco.Web/umbraco.presentation/content.cs
This commit is contained in:
Shannon
2015-03-27 15:15:49 +11:00
7 changed files with 29 additions and 6 deletions

View File

@@ -8,6 +8,8 @@
bool DisableAlternativeTemplates { get; } bool DisableAlternativeTemplates { get; }
bool DisableFindContentByIdPath { get; }
string UrlProviderMode { get; } string UrlProviderMode { get; }
} }

View File

@@ -21,6 +21,11 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
{ {
get { return (bool) base["disableAlternativeTemplates"]; } get { return (bool) base["disableAlternativeTemplates"]; }
} }
[ConfigurationProperty("disableFindContentByIdPath", DefaultValue = "false")]
public bool DisableFindContentByIdPath
{
get { return (bool) base["disableFindContentByIdPath"]; }
}
[ConfigurationProperty("urlProviderMode", DefaultValue = "AutoLegacy")] [ConfigurationProperty("urlProviderMode", DefaultValue = "AutoLegacy")]
public string UrlProviderMode public string UrlProviderMode

View File

@@ -327,6 +327,11 @@ function mediaHelper(umbRequestHelper) {
* @param {string} imagePath Image path, ex: /media/1234/my-image.jpg * @param {string} imagePath Image path, ex: /media/1234/my-image.jpg
*/ */
detectIfImageByExtension: function (imagePath) { detectIfImageByExtension: function (imagePath) {
if (!imagePath) {
return false;
}
var lowered = imagePath.toLowerCase(); var lowered = imagePath.toLowerCase();
var ext = lowered.substr(lowered.lastIndexOf(".") + 1); var ext = lowered.substr(lowered.lastIndexOf(".") + 1);
return ("," + Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes + ",").indexOf("," + ext + ",") !== -1; return ("," + Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes + ",").indexOf("," + ext + ",") !== -1;

View File

@@ -137,10 +137,14 @@
will make Umbraco render the content on the current page with the template you requested, for example: will make Umbraco render the content on the current page with the template you requested, for example:
http://mysite.com/about-us/?altTemplate=Home and http://mysite.com/about-us/Home would render the http://mysite.com/about-us/?altTemplate=Home and http://mysite.com/about-us/Home would render the
"About Us" page with a template with the alias Home. Setting this setting to true stops that behavior "About Us" page with a template with the alias Home. Setting this setting to true stops that behavior
@disableFindContentByIdPath
By default you can call any content Id in the url and show the content with that id, for example:
http://mysite.com/1092 or http://mysite.com/1092.aspx would render the content with id 1092. Setting
this setting to true stops that behavior
--> -->
<web.routing <web.routing
trySkipIisCustomErrors="false" trySkipIisCustomErrors="false"
internalRedirectPreservesTemplate="false" disableAlternativeTemplates="false"> internalRedirectPreservesTemplate="false" disableAlternativeTemplates="false" disableFindContentByIdPath="false">
</web.routing> </web.routing>
</settings> </settings>

View File

@@ -295,10 +295,14 @@
will make Umbraco render the content on the current page with the template you requested, for example: will make Umbraco render the content on the current page with the template you requested, for example:
http://mysite.com/about-us/?altTemplate=Home and http://mysite.com/about-us/Home would render the http://mysite.com/about-us/?altTemplate=Home and http://mysite.com/about-us/Home would render the
"About Us" page with a template with the alias Home. Setting this setting to true stops that behavior "About Us" page with a template with the alias Home. Setting this setting to true stops that behavior
@disableFindContentByIdPath
By default you can call any content Id in the url and show the content with that id, for example:
http://mysite.com/1092 or http://mysite.com/1092.aspx would render the content with id 1092. Setting
this setting to true stops that behavior
--> -->
<web.routing <web.routing
trySkipIisCustomErrors="false" trySkipIisCustomErrors="false"
internalRedirectPreservesTemplate="false" disableAlternativeTemplates="false"> internalRedirectPreservesTemplate="false" disableAlternativeTemplates="false" disableFindContentByIdPath="false">
</web.routing> </web.routing>
</settings> </settings>

View File

@@ -2,6 +2,7 @@ using System;
using Umbraco.Core.Logging; using Umbraco.Core.Logging;
using Umbraco.Core.Models; using Umbraco.Core.Models;
using Umbraco.Core; using Umbraco.Core;
using Umbraco.Core.Configuration;
namespace Umbraco.Web.Routing namespace Umbraco.Web.Routing
{ {
@@ -20,6 +21,9 @@ namespace Umbraco.Web.Routing
/// <returns>A value indicating whether an Umbraco document was found and assigned.</returns> /// <returns>A value indicating whether an Umbraco document was found and assigned.</returns>
public bool TryFindContent(PublishedContentRequest docRequest) public bool TryFindContent(PublishedContentRequest docRequest)
{ {
if (UmbracoConfig.For.UmbracoSettings().WebRouting.DisableFindContentByIdPath)
return false;
IPublishedContent node = null; IPublishedContent node = null;
var path = docRequest.Uri.GetAbsolutePathDecoded(); var path = docRequest.Uri.GetAbsolutePathDecoded();

View File

@@ -51,7 +51,6 @@ namespace Umbraco.Web.Scheduling
} }
// scrubbing interval, in milliseconds
public static int GetLogScrubbingInterval(IUmbracoSettingsSection settings) public static int GetLogScrubbingInterval(IUmbracoSettingsSection settings)
{ {
var interval = 4 * 60 * 60 * 1000; // 4 hours, in milliseconds var interval = 4 * 60 * 60 * 1000; // 4 hours, in milliseconds
@@ -62,7 +61,7 @@ namespace Umbraco.Web.Scheduling
} }
catch (Exception e) catch (Exception e)
{ {
LogHelper.Error<Scheduler>("Unable to locate a log scrubbing interval. Defaulting to 4 hours.", e); LogHelper.Error<LogScrubber>("Unable to locate a log scrubbing interval. Defaulting to 4 hours.", e);
} }
return interval; return interval;
} }