Macros - cache xslt settings
This commit is contained in:
@@ -51,6 +51,7 @@ namespace umbraco
|
||||
|
||||
/// <summary>Cache for <see cref="GetPredefinedXsltExtensions"/>.</summary>
|
||||
private static Dictionary<string, object> _predefinedExtensions;
|
||||
private static XsltSettings _xsltSettings;
|
||||
private const string LoadUserControlKey = "loadUserControl";
|
||||
private readonly StringBuilder _content = new StringBuilder();
|
||||
private const string MacrosAddedKey = "macrosAdded";
|
||||
@@ -61,6 +62,13 @@ namespace umbraco
|
||||
get { return Application.SqlHelper; }
|
||||
}
|
||||
|
||||
static macro()
|
||||
{
|
||||
_xsltSettings = GlobalSettings.ApplicationTrustLevel > AspNetHostingPermissionLevel.Medium
|
||||
? XsltSettings.TrustedXslt
|
||||
: XsltSettings.Default;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public properties
|
||||
@@ -822,14 +830,7 @@ namespace umbraco
|
||||
|
||||
try
|
||||
{
|
||||
if (GlobalSettings.ApplicationTrustLevel > AspNetHostingPermissionLevel.Medium)
|
||||
{
|
||||
macroXslt.Load(xslReader, XsltSettings.TrustedXslt, xslResolver);
|
||||
}
|
||||
else
|
||||
{
|
||||
macroXslt.Load(xslReader, XsltSettings.Default, xslResolver);
|
||||
}
|
||||
macroXslt.Load(xslReader, _xsltSettings, xslResolver);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user