PortableInfobox/services/Sanitizers/NodeImageSanitizer.php

20 lines
508 B
PHP
Raw Normal View History

2015-12-23 14:54:03 +00:00
<?php
class NodeImageSanitizer extends NodeSanitizer {
2016-01-04 12:09:39 +00:00
protected $allowedTags = [ 'a' ];
2016-01-04 11:09:50 +00:00
protected $selectorsWrappingAllowedFeatures = [ 'sup[@class="reference"]' ];
protected $selectorsForFullRemoval = [ 'script', 'span[@itemprop="duration"]' ];
2015-12-23 14:54:03 +00:00
/**
* @desc sanitize infobox image caption allowing only for links inside it
*
* @param $data
* @return mixed
*/
public function sanitize( $data ) {
2016-01-04 12:09:39 +00:00
$data[ 'caption' ] = $this->sanitizeElementData( $data[ 'caption' ] );
2015-12-23 14:54:03 +00:00
return $data;
}
}