PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / trunk
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress vtrunk
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
acymailing / back / Helpers / SecurityHelper.php

SecurityHelper.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress trunk, at back/Helpers/SecurityHelper.php

218 lines 5.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace AcyMailing\Helpers;
4
5 use AcyMailing\Core\AcymObject;
6
7 class SecurityHelper extends AcymObject
8 {
9 const ALLOWED_HTML_DATE = [
10 'div' => [
11 'class' => true,
12 'style' => true,
13 'id' => true,
14 'data-reveal' => true,
15 'data-reveal-larger' => true,
16 ],
17 'input' => [
18 'type' => true,
19 'name' => true,
20 'id' => true,
21 'value' => true,
22 'class' => true,
23 'data-open' => true,
24 'readonly' => true,
25 'data-rs' => true,
26 'onchange' => true,
27 'data-reveal' => true,
28 'data-reveal-larger' => true,
29 ],
30 'span' => ['class' => true, 'aria-hidden' => true],
31 'button' => [
32 'type' => true,
33 'class' => true,
34 'data-close' => true,
35 'data-type' => true,
36 'aria-label' => true,
37 'data-open' => true,
38 ],
39 'select' => [
40 'id' => true,
41 'name' => true,
42 'class' => true,
43 ],
44 'optgroup' => ['label' => true],
45 'option' => ['value' => true, 'selected' => true, 'disabled' => true],
46 ];
47
48 const ALLOWED_HTML_SELECT = [
49 'select' => [
50 'class' => true,
51 'name' => true,
52 'id' => true,
53 ],
54 'option' => [
55 'value' => true,
56 'selected' => true,
57 'disabled' => true,
58 ],
59 ];
60
61 const ALLOWED_HTML_TERMS = [
62 'a' => [
63 'href' => true,
64 'target' => true,
65 'title' => true,
66 'class' => true,
67 'rel' => true,
68 'aria-label' => true,
69 'data-acym-modal' => true,
70 ],
71 'div' => [
72 'class' => true,
73 'id' => true,
74 'style' => true,
75 ],
76 'span' => [
77 ],
78 'iframe' => [
79 'class' => true,
80 'src' => true,
81 ],
82 ];
83
84 const ALLOWED_HTML_FIELD_NAME = [
85 'b' => [],
86 'br' => [],
87 'strong' => [],
88 'em' => [],
89 'i' => [],
90 'span' => [
91 'class' => true,
92 ],
93 ];
94
95 const ALLOWED_HTML_INTRO = [
96 'i' => [
97 'class' => true,
98 ],
99 'b' => [
100 'class' => true,
101 ],
102 'p' => [
103 'class' => true,
104 ],
105 'strong' => [
106 'class' => true,
107 ],
108 'span' => [
109 'class' => true,
110 ],
111 ];
112
113 const ALLOWED_HTML_NOTIFICATION = [
114 'a' => [
115 'href' => true,
116 'target' => true,
117 'id' => true,
118 'class' => true,
119 'title' => true,
120 ],
121 'b' => [],
122 'br' => [],
123 'i' => [],
124 'p' => [
125 'class' => true,
126 'title' => true,
127 ],
128 'pre' => [],
129 'strong' => [],
130 ];
131
132 const ALLOWED_HTML_MESSAGE = [
133 'a' => [
134 'href' => true,
135 'target' => true,
136 'id' => true,
137 'class' => true,
138 'title' => true,
139 ],
140 'b' => [],
141 'br' => [],
142 'div' => [
143 'button' => [
144 'type' => true,
145 'class' => true,
146 'aria-label' => true,
147 'data-open' => true,
148 'data-ajax' => true,
149 'data-iframe' => true,
150 'data-close' => true,
151 'data-acym-email-id' => true,
152 ],
153 'class' => true,
154 'id' => true,
155 'data-reveal' => true,
156 'data-reveal-larger' => true,
157 ],
158 'i' => [],
159 'li' => [],
160 'p' => [
161 'class' => true,
162 'title' => true,
163 ],
164 'pre' => [],
165 'span' => [
166 'class' => true,
167 'data-acym-email-id' => true,
168 'aria-hidden' => true,
169 ],
170 'strong' => [],
171 'ul' => [],
172 ];
173
174 const ALLOWED_HTML_CHECKBOX_LABEL = [
175 'div' => [
176 'class' => true,
177 ],
178 'span' => [
179 'class' => true,
180 ],
181 'input' => [
182 'class' => true,
183 'type' => true,
184 'name' => true,
185 'value' => true,
186 ],
187 'select' => [
188 'class' => true,
189 'name' => true,
190 'id' => true,
191 ],
192 'option' => [
193 'value' => true,
194 'selected' => true,
195 'disabled' => true,
196 ],
197 ];
198
199 const ALLOWED_HTML_PARAM_FIELD = [
200 'input' => [
201 'type' => true,
202 'name' => true,
203 'value' => true,
204 ],
205 'select' => [
206 'class' => true,
207 'id' => true,
208 'name' => true,
209 'multiple' => true,
210 ],
211 'option' => [
212 'value' => true,
213 'selected' => true,
214 'disabled' => true,
215 ],
216 ];
217 }
218