8
8
using Umbraco . Core . Models ;
9
9
using Umbraco . Core . Models . Editors ;
10
10
using Umbraco . Core . PropertyEditors ;
11
+ using Umbraco . Core . Security ;
11
12
using Umbraco . Core . Services ;
12
13
using Umbraco . Web . Templates ;
13
14
@@ -32,8 +33,9 @@ public class GridPropertyEditor : DataEditor
32
33
private readonly RichTextEditorPastedImages _pastedImages ;
33
34
private readonly HtmlLocalLinkParser _localLinkParser ;
34
35
private readonly IImageUrlGenerator _imageUrlGenerator ;
36
+ private readonly IHtmlSanitizer _htmlSanitizer ;
35
37
36
- [ Obsolete ( "Use the constructor which takes an IImageUrlGenerator " ) ]
38
+ [ Obsolete ( "Use the constructor which takes an IHtmlSanitizer " ) ]
37
39
public GridPropertyEditor ( ILogger logger ,
38
40
IUmbracoContextAccessor umbracoContextAccessor ,
39
41
HtmlImageSourceParser imageSourceParser ,
@@ -43,19 +45,32 @@ public GridPropertyEditor(ILogger logger,
43
45
{
44
46
}
45
47
48
+ [ Obsolete ( "Use the constructor which takes an IHtmlSanitizer" ) ]
46
49
public GridPropertyEditor ( ILogger logger ,
47
50
IUmbracoContextAccessor umbracoContextAccessor ,
48
51
HtmlImageSourceParser imageSourceParser ,
49
52
RichTextEditorPastedImages pastedImages ,
50
53
HtmlLocalLinkParser localLinkParser ,
51
54
IImageUrlGenerator imageUrlGenerator )
55
+ : this ( logger , umbracoContextAccessor , imageSourceParser , pastedImages , localLinkParser , imageUrlGenerator , Current . Factory . GetInstance < IHtmlSanitizer > ( ) )
56
+ {
57
+ }
58
+
59
+ public GridPropertyEditor ( ILogger logger ,
60
+ IUmbracoContextAccessor umbracoContextAccessor ,
61
+ HtmlImageSourceParser imageSourceParser ,
62
+ RichTextEditorPastedImages pastedImages ,
63
+ HtmlLocalLinkParser localLinkParser ,
64
+ IImageUrlGenerator imageUrlGenerator ,
65
+ IHtmlSanitizer htmlSanitizer )
52
66
: base ( logger )
53
67
{
54
68
_umbracoContextAccessor = umbracoContextAccessor ;
55
69
_imageSourceParser = imageSourceParser ;
56
70
_pastedImages = pastedImages ;
57
71
_localLinkParser = localLinkParser ;
58
72
_imageUrlGenerator = imageUrlGenerator ;
73
+ _htmlSanitizer = htmlSanitizer ;
59
74
}
60
75
61
76
public override IPropertyIndexValueFactory PropertyIndexValueFactory => new GridPropertyIndexValueFactory ( ) ;
@@ -64,7 +79,7 @@ public GridPropertyEditor(ILogger logger,
64
79
/// Overridden to ensure that the value is validated
65
80
/// </summary>
66
81
/// <returns></returns>
67
- protected override IDataValueEditor CreateValueEditor ( ) => new GridPropertyValueEditor ( Attribute , _umbracoContextAccessor , _imageSourceParser , _pastedImages , _localLinkParser , _imageUrlGenerator ) ;
82
+ protected override IDataValueEditor CreateValueEditor ( ) => new GridPropertyValueEditor ( Attribute , _umbracoContextAccessor , _imageSourceParser , _pastedImages , _localLinkParser , _imageUrlGenerator , _htmlSanitizer ) ;
68
83
69
84
protected override IConfigurationEditor CreateConfigurationEditor ( ) => new GridConfigurationEditor ( ) ;
70
85
@@ -77,7 +92,7 @@ internal class GridPropertyValueEditor : DataValueEditor, IDataValueReference
77
92
private readonly MediaPickerPropertyEditor . MediaPickerPropertyValueEditor _mediaPickerPropertyValueEditor ;
78
93
private readonly IImageUrlGenerator _imageUrlGenerator ;
79
94
80
- [ Obsolete ( "Use the constructor which takes an IImageUrlGenerator " ) ]
95
+ [ Obsolete ( "Use the constructor which takes an IHtmlSanitizer " ) ]
81
96
public GridPropertyValueEditor ( DataEditorAttribute attribute ,
82
97
IUmbracoContextAccessor umbracoContextAccessor ,
83
98
HtmlImageSourceParser imageSourceParser ,
@@ -87,20 +102,32 @@ public GridPropertyValueEditor(DataEditorAttribute attribute,
87
102
{
88
103
}
89
104
105
+ [ Obsolete ( "Use the constructor which takes an IHtmlSanitizer" ) ]
90
106
public GridPropertyValueEditor ( DataEditorAttribute attribute ,
91
107
IUmbracoContextAccessor umbracoContextAccessor ,
92
108
HtmlImageSourceParser imageSourceParser ,
93
109
RichTextEditorPastedImages pastedImages ,
94
110
HtmlLocalLinkParser localLinkParser ,
95
111
IImageUrlGenerator imageUrlGenerator )
112
+ : this ( attribute , umbracoContextAccessor , imageSourceParser , pastedImages , localLinkParser , imageUrlGenerator , Current . Factory . GetInstance < IHtmlSanitizer > ( ) )
113
+ {
114
+ }
115
+
116
+ public GridPropertyValueEditor ( DataEditorAttribute attribute ,
117
+ IUmbracoContextAccessor umbracoContextAccessor ,
118
+ HtmlImageSourceParser imageSourceParser ,
119
+ RichTextEditorPastedImages pastedImages ,
120
+ HtmlLocalLinkParser localLinkParser ,
121
+ IImageUrlGenerator imageUrlGenerator ,
122
+ IHtmlSanitizer htmlSanitizer )
96
123
: base ( attribute )
97
124
{
98
125
_umbracoContextAccessor = umbracoContextAccessor ;
99
126
_imageSourceParser = imageSourceParser ;
100
127
_pastedImages = pastedImages ;
101
- _richTextPropertyValueEditor = new RichTextPropertyEditor . RichTextPropertyValueEditor ( attribute , umbracoContextAccessor , imageSourceParser , localLinkParser , pastedImages , _imageUrlGenerator ) ;
102
- _mediaPickerPropertyValueEditor = new MediaPickerPropertyEditor . MediaPickerPropertyValueEditor ( attribute ) ;
103
128
_imageUrlGenerator = imageUrlGenerator ;
129
+ _richTextPropertyValueEditor = new RichTextPropertyEditor . RichTextPropertyValueEditor ( attribute , umbracoContextAccessor , imageSourceParser , localLinkParser , pastedImages , _imageUrlGenerator , htmlSanitizer ) ;
130
+ _mediaPickerPropertyValueEditor = new MediaPickerPropertyEditor . MediaPickerPropertyValueEditor ( attribute ) ;
104
131
}
105
132
106
133
/// <summary>
0 commit comments