PortableInfobox/services/Sanitizers/NodeImageSanitizer.php

19 lines
459 B
PHP
Raw Normal View History

2015-12-23 14:54:03 +00:00
<?php
class NodeImageSanitizer extends NodeSanitizer {
protected $fullyAllowedTags = [ 'sup[@class="reference"]' ];
protected $fullyRemovedTags = [ '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 ) {
$data[ 'caption' ] = $this->sanitizeElementData( $data[ 'caption' ], [ 'a' ] );
2015-12-23 14:54:03 +00:00
return $data;
}
}