Skip to content

Commit 53faf4f

Browse files
committed
Gradient support added to svg icons
1 parent 9b6ddb1 commit 53faf4f

1 file changed

Lines changed: 65 additions & 2 deletions

File tree

classes/Input.php

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ public static function allow_iframe( $tags, $context ) {
380380
public static function allow_svg( $allowed_tags ) {
381381
$svg_tags = array(
382382
'svg' => array(
383+
'id' => true,
383384
'class' => true,
384385
'aria-hidden' => true,
385386
'aria-label' => true,
@@ -389,12 +390,17 @@ public static function allow_svg( $allowed_tags ) {
389390
'height' => true,
390391
'viewbox' => true,
391392
'fill' => true,
393+
'style' => true,
392394
),
393395
'g' => array(
394-
'fill' => true,
395-
'opacity' => true,
396+
'id' => true,
397+
'fill' => true,
398+
'opacity' => true,
399+
'transform' => true,
400+
'style' => true,
396401
),
397402
'path' => array(
403+
'id' => true,
398404
'd' => true,
399405
'fill' => true,
400406
'stroke' => true,
@@ -406,8 +412,11 @@ public static function allow_svg( $allowed_tags ) {
406412
'fill-rule' => true,
407413
'clip-rule' => true,
408414
'opacity' => true,
415+
'transform' => true,
416+
'style' => true,
409417
),
410418
'circle' => array(
419+
'id' => true,
411420
'cx' => true,
412421
'cy' => true,
413422
'r' => true,
@@ -419,8 +428,11 @@ public static function allow_svg( $allowed_tags ) {
419428
'stroke-dasharray' => true,
420429
'stroke-dashoffset' => true,
421430
'opacity' => true,
431+
'transform' => true,
432+
'style' => true,
422433
),
423434
'rect' => array(
435+
'id' => true,
424436
'x' => true,
425437
'y' => true,
426438
'width' => true,
@@ -434,8 +446,11 @@ public static function allow_svg( $allowed_tags ) {
434446
'stroke-dashoffset' => true,
435447
'opacity' => true,
436448
'rx' => true,
449+
'transform' => true,
450+
'style' => true,
437451
),
438452
'line' => array(
453+
'id' => true,
439454
'x1' => true,
440455
'x2' => true,
441456
'y1' => true,
@@ -447,8 +462,11 @@ public static function allow_svg( $allowed_tags ) {
447462
'stroke-dasharray' => true,
448463
'stroke-dashoffset' => true,
449464
'opacity' => true,
465+
'transform' => true,
466+
'style' => true,
450467
),
451468
'polyline' => array(
469+
'id' => true,
452470
'points' => true,
453471
'fill' => true,
454472
'stroke' => true,
@@ -458,8 +476,11 @@ public static function allow_svg( $allowed_tags ) {
458476
'stroke-dasharray' => true,
459477
'stroke-dashoffset' => true,
460478
'opacity' => true,
479+
'transform' => true,
480+
'style' => true,
461481
),
462482
'polygon' => array(
483+
'id' => true,
463484
'points' => true,
464485
'fill' => true,
465486
'stroke' => true,
@@ -469,6 +490,48 @@ public static function allow_svg( $allowed_tags ) {
469490
'stroke-dasharray' => true,
470491
'stroke-dashoffset' => true,
471492
'opacity' => true,
493+
'transform' => true,
494+
'style' => true,
495+
),
496+
'defs' => array(),
497+
'lineargradient' => array(
498+
'id' => true,
499+
'x1' => true,
500+
'y1' => true,
501+
'x2' => true,
502+
'y2' => true,
503+
'gradientunits' => true,
504+
'gradienttransform' => true,
505+
'spreadmethod' => true,
506+
'xlink:href' => true,
507+
),
508+
'radialgradient' => array(
509+
'id' => true,
510+
'cx' => true,
511+
'cy' => true,
512+
'r' => true,
513+
'fx' => true,
514+
'fy' => true,
515+
'gradientunits' => true,
516+
'gradienttransform' => true,
517+
'spreadmethod' => true,
518+
'xlink:href' => true,
519+
),
520+
'stop' => array(
521+
'offset' => true,
522+
'stop-color' => true,
523+
'stop-opacity' => true,
524+
),
525+
'clippath' => array(
526+
'id' => true,
527+
),
528+
'use' => array(
529+
'id' => true,
530+
'x' => true,
531+
'y' => true,
532+
'width' => true,
533+
'height' => true,
534+
'xlink:href' => true,
472535
),
473536
);
474537

0 commit comments

Comments
 (0)