2015-12-23 14:54:03 +00:00
|
|
|
<?php
|
|
|
|
|
2018-08-09 09:49:10 +00:00
|
|
|
namespace PortableInfobox\Sanitizers;
|
|
|
|
|
2015-12-29 07:10:24 +00:00
|
|
|
class NodeHorizontalGroupSanitizer extends NodeSanitizer {
|
2016-01-04 12:09:39 +00:00
|
|
|
protected $allowedTags = [ 'a' ];
|
|
|
|
|
2015-12-23 14:54:03 +00:00
|
|
|
/**
|
2018-08-16 09:25:53 +00:00
|
|
|
* @param mixed $data
|
2015-12-23 14:54:03 +00:00
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function sanitize( $data ) {
|
2018-08-16 09:25:53 +00:00
|
|
|
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 ) ) {
|
2018-08-16 09:25:53 +00:00
|
|
|
$data['labels'][$key] = $sanitizedLabel;
|
2015-12-23 14:54:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
}
|