File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 4242 <dependency id =" Microsoft.Owin.Security.Cookies" version =" [4.0.1,4.999999)" />
4343 <dependency id =" Microsoft.Owin.Security.OAuth" version =" [4.0.1,4.999999)" />
4444 <dependency id =" System.Threading.Tasks.Dataflow" version =" [4.9.0,4.999999)" />
45- <dependency id =" HtmlSanitizer" version =" [4 .0.217,4 .999999)" />
45+ <dependency id =" HtmlSanitizer" version =" [5 .0.376,5 .999999)" />
4646
4747 </group >
4848
Original file line number Diff line number Diff line change 4040using Umbraco . Web . PropertyEditors ;
4141using Umbraco . Core . Models ;
4242using Umbraco . Web . Models ;
43+ using Ganss . XSS ;
4344
4445namespace Umbraco . Web . Runtime
4546{
@@ -139,6 +140,14 @@ public override void Compose(Composition composition)
139140 composition . RegisterUnique < ISectionService , SectionService > ( ) ;
140141 composition . RegisterUnique < IDashboardService , DashboardService > ( ) ;
141142 composition . RegisterUnique < IIconService , IconService > ( ) ;
143+ composition . Register < IHtmlSanitizer > ( _ =>
144+ {
145+ var sanitizer = new HtmlSanitizer ( ) ;
146+ sanitizer . AllowedAttributes . UnionWith ( Umbraco . Core . Constants . SvgSanitizer . Attributes ) ;
147+ sanitizer . AllowedCssProperties . UnionWith ( Umbraco . Core . Constants . SvgSanitizer . Attributes ) ;
148+ sanitizer . AllowedTags . UnionWith ( Umbraco . Core . Constants . SvgSanitizer . Tags ) ;
149+ return sanitizer ;
150+ } , Lifetime . Singleton ) ;
142151
143152 composition . RegisterUnique < IExamineManager > ( factory => ExamineManager . Instance ) ;
144153
Original file line number Diff line number Diff line change 6767 <PackageReference Include =" HtmlAgilityPack" Version =" 1.8.14" />
6868 <PackageReference Include =" HtmlSanitizer" >
6969 <Version >4.0.217</Version >
70+ <Version >5.0.376</Version >
7071 </PackageReference >
7172 <PackageReference Include =" ImageProcessor" >
7273 <Version >2.7.0.100</Version >
12861287 </PropertyGroup >
12871288 <ItemGroup >
12881289 <!-- we want to exclude all facade references ?! -->
1289- <FixedReferencePath Include =" @(ReferencePath)" Condition =" '%(ReferencePath.FileName)' != 'System.ValueTuple' and '%(ReferencePath.FileName)' != 'System.Net.Http'" />
1290+ <FixedReferencePath Include =" @(ReferencePath)" Condition =" '%(ReferencePath.FileName)' != 'System.ValueTuple' and '%(ReferencePath.FileName)' != 'System.Net.Http' and '%(ReferencePath.FileName)' != 'System.Text.Encoding.CodePages' " />
12901291 </ItemGroup >
12911292 <Delete Files =" $(TargetDir)$(TargetName).XmlSerializers.dll" ContinueOnError =" true" />
12921293 <!--
12961297 <Output TaskParameter =" SerializationAssembly" ItemName =" SerializationAssembly" />
12971298 </SGen >
12981299 </Target >
1299- </Project >
1300+ </Project >
You can’t perform that action at this time.
0 commit comments