PortableInfobox/services/Sanitizers/NodeImageSanitizer.php
2016-01-04 12:09:39 +00:00

20 lines
508 B
PHP

<?php
class NodeImageSanitizer extends NodeSanitizer {
protected $allowedTags = [ 'a' ];
protected $selectorsWrappingAllowedFeatures = [ 'sup[@class="reference"]' ];
protected $selectorsForFullRemoval = [ 'script', 'span[@itemprop="duration"]' ];
/**
* @desc sanitize infobox image caption allowing only for links inside it
*
* @param $data
* @return mixed
*/
public function sanitize( $data ) {
$data[ 'caption' ] = $this->sanitizeElementData( $data[ 'caption' ] );
return $data;
}
}