Removing file location restriction from PartialViewMacro to allow custom paths.

This commit is contained in:
neehouse
2013-09-06 15:34:19 -04:00
parent 349dc9a228
commit d821401ea2

View File

@@ -104,11 +104,11 @@ namespace Umbraco.Web.Macros
if (currentPage == null) throw new ArgumentNullException("currentPage");
if (macro.ScriptName.IsNullOrWhiteSpace()) throw new ArgumentException("The ScriptName property of the macro object cannot be null or empty");
if (!macro.ScriptName.StartsWith(SystemDirectories.MvcViews + "/MacroPartials/")
&& (!Regex.IsMatch(macro.ScriptName, "~/App_Plugins/.+?/Views/MacroPartials", RegexOptions.Compiled)))
{
throw new InvalidOperationException("Cannot render the Partial View Macro with file: " + macro.ScriptName + ". All Partial View Macros must exist in the " + SystemDirectories.MvcViews + "/MacroPartials/ folder");
}
//if (!macro.ScriptName.StartsWith(SystemDirectories.MvcViews + "/MacroPartials/")
// && (!Regex.IsMatch(macro.ScriptName, "~/App_Plugins/.+?/Views/MacroPartials", RegexOptions.Compiled)))
//{
// throw new InvalidOperationException("Cannot render the Partial View Macro with file: " + macro.ScriptName + ". All Partial View Macros must exist in the " + SystemDirectories.MvcViews + "/MacroPartials/ folder");
//}
var http = _getHttpContext();
var umbCtx = _getUmbracoContext();