| 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-acym-translate' => true, |
| 26 |
'data-rs' => true, |
| 27 |
'onchange' => true, |
| 28 |
'data-reveal' => true, |
| 29 |
'data-reveal-larger' => true, |
| 30 |
], |
| 31 |
'span' => ['class' => true, 'aria-hidden' => true], |
| 32 |
'button' => [ |
| 33 |
'type' => true, |
| 34 |
'class' => true, |
| 35 |
'data-close' => true, |
| 36 |
'data-type' => true, |
| 37 |
'aria-label' => true, |
| 38 |
'data-open' => true, |
| 39 |
], |
| 40 |
'select' => [ |
| 41 |
'id' => true, |
| 42 |
'name' => true, |
| 43 |
'class' => true, |
| 44 |
], |
| 45 |
'optgroup' => ['label' => true], |
| 46 |
'option' => ['value' => true, 'selected' => true, 'disabled' => true], |
| 47 |
]; |
| 48 |
|
| 49 |
const ALLOWED_HTML_SELECT = [ |
| 50 |
'select' => [ |
| 51 |
'class' => true, |
| 52 |
'name' => true, |
| 53 |
'id' => true, |
| 54 |
], |
| 55 |
'option' => [ |
| 56 |
'value' => true, |
| 57 |
'selected' => true, |
| 58 |
'disabled' => true, |
| 59 |
], |
| 60 |
]; |
| 61 |
|
| 62 |
const ALLOWED_HTML_TERMS = [ |
| 63 |
'a' => [ |
| 64 |
'href' => true, |
| 65 |
'target' => true, |
| 66 |
'title' => true, |
| 67 |
'class' => true, |
| 68 |
'rel' => true, |
| 69 |
'aria-label' => true, |
| 70 |
'data-acym-modal' => true, |
| 71 |
], |
| 72 |
'div' => [ |
| 73 |
'class' => true, |
| 74 |
'id' => true, |
| 75 |
'style' => true, |
| 76 |
], |
| 77 |
'span' => [ |
| 78 |
], |
| 79 |
'iframe' => [ |
| 80 |
'class' => true, |
| 81 |
'src' => true, |
| 82 |
], |
| 83 |
]; |
| 84 |
|
| 85 |
const ALLOWED_HTML_FIELD_NAME = [ |
| 86 |
'b' => [], |
| 87 |
'br' => [], |
| 88 |
'strong' => [], |
| 89 |
'em' => [], |
| 90 |
'i' => [], |
| 91 |
'span' => [ |
| 92 |
'class' => true, |
| 93 |
], |
| 94 |
]; |
| 95 |
|
| 96 |
const ALLOWED_HTML_INTRO = [ |
| 97 |
'i' => [ |
| 98 |
'class' => true, |
| 99 |
], |
| 100 |
'b' => [ |
| 101 |
'class' => true, |
| 102 |
], |
| 103 |
'p' => [ |
| 104 |
'class' => true, |
| 105 |
], |
| 106 |
'strong' => [ |
| 107 |
'class' => true, |
| 108 |
], |
| 109 |
'span' => [ |
| 110 |
'class' => true, |
| 111 |
], |
| 112 |
]; |
| 113 |
} |
| 114 |
|