| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* The function `gutslider_allowed_svg_tags` defines an array of allowed SVG tags and their attributes |
| 5 |
* for use in a PHP application. |
| 6 |
* |
| 7 |
* @return An array of allowed SVG tags and their attributes is being returned. The 'svg' tag allows |
| 8 |
* attributes such as class, aria-hidden, aria-labelledby, role, xmlns, width, height, and viewbox. The |
| 9 |
* 'g' tag allows the fill attribute. The 'title' tag allows the title attribute. The 'path' tag allows |
| 10 |
* the d and fill attributes. |
| 11 |
*/ |
| 12 |
function gutslider_allowed_svg_tags() { |
| 13 |
return array( |
| 14 |
'svg' => array( |
| 15 |
'class' => true, |
| 16 |
'aria-hidden' => true, |
| 17 |
'aria-labelledby' => true, |
| 18 |
'role' => true, |
| 19 |
'xmlns' => true, |
| 20 |
'width' => true, |
| 21 |
'height' => true, |
| 22 |
'viewbox' => true, // <= Must be lower case! |
| 23 |
), |
| 24 |
'g' => array( 'fill' => true ), |
| 25 |
'title' => array( 'title' => true ), |
| 26 |
'path' => array( |
| 27 |
'd' => true, |
| 28 |
'fill' => true, |
| 29 |
), |
| 30 |
); |
| 31 |
} |