PortableInfobox/services/Sanitizers/NodeImageSanitizer.php

19 lines
482 B
PHP
Raw Normal View History

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