This commit is contained in:
Stephan
2012-09-28 11:14:04 -02:00
9 changed files with 143 additions and 149 deletions

View File

@@ -1146,9 +1146,7 @@ namespace Umbraco.Core.Configuration
}
catch (Exception ex)
{
Trace.WriteLine("Could not load /settings/templates/enableMvcSupport from umbracosettings.config:\r\n {0}",
ex.Message);
LogHelper.Error<UmbracoSettings>("Could not load /settings/templates/enableMvcSupport from umbracosettings.config", ex);
_enableMvc = false;
}
}
@@ -1156,35 +1154,6 @@ namespace Umbraco.Core.Configuration
}
}
private static string[] _mvcViewExtensions;
public static string[] MvcViewExtensions
{
get
{
string[] defaultValue = "cshtml".Split(',');
if (_mvcViewExtensions == null)
{
try
{
string value = GetKey("/settings/templates/mvcViewExtensions");
if (!string.IsNullOrEmpty(value))
_mvcViewExtensions = value.Split(',');
else
_mvcViewExtensions = defaultValue;
}
catch (Exception ex)
{
Trace.WriteLine("Could not load /settings/templates/mvcViewExtensions from umbracosettings.config:\r\n {0}",
ex.Message);
_mvcViewExtensions = defaultValue;
}
}
return _mvcViewExtensions;
}
}
/// <summary>
/// Configuration regarding webservices

View File

@@ -152,7 +152,7 @@ namespace Umbraco.Core.IO
/// <param name="filePath">filepath </param>
/// <param name="validDir"></param>
/// <returns>true if valid, throws a FileSecurityException if not</returns>
public static bool ValidateEditPath(string filePath, string validDir)
internal static bool ValidateEditPath(string filePath, string validDir)
{
if (!filePath.StartsWith(MapPath(SystemDirectories.Root)))
filePath = MapPath(filePath);
@@ -165,7 +165,7 @@ namespace Umbraco.Core.IO
return true;
}
public static bool ValidateEditPath(string filePath, string[] validDirs)
internal static bool ValidateEditPath(string filePath, IEnumerable<string> validDirs)
{
foreach (var dir in validDirs)
{
@@ -182,7 +182,7 @@ namespace Umbraco.Core.IO
throw new FileSecurityException(String.Format("The filepath '{0}' is not within an allowed directory for this type of files", filePath.Replace(MapPath(SystemDirectories.Root), "")));
}
public static bool ValidateFileExtension(string filePath, List<string> validFileExtensions)
internal static bool ValidateFileExtension(string filePath, List<string> validFileExtensions)
{
if (!filePath.StartsWith(MapPath(SystemDirectories.Root)))
filePath = MapPath(filePath);