PortableInfobox/includes/services/Sanitizers/NodeHorizontalGroupSanitizer.php

23 lines
452 B
PHP
Raw Normal View History

2015-12-23 14:54:03 +00:00
<?php
namespace PortableInfobox\Sanitizers;
class NodeHorizontalGroupSanitizer extends NodeSanitizer {
2016-01-04 12:09:39 +00:00
protected $allowedTags = [ 'a' ];
2015-12-23 14:54:03 +00:00
/**
* @param $data
* @return mixed
*/
public function sanitize( $data ) {
foreach ( $data[ 'labels' ] as $key => $label ) {
2016-01-04 12:09:39 +00:00
$sanitizedLabel = $this->sanitizeElementData( $label );
2015-12-23 14:54:03 +00:00
if ( !empty( $sanitizedLabel ) ) {
$data[ 'labels' ][ $key ] = $sanitizedLabel;
}
}
return $data;
}
}