2015-12-23 14:54:03 +00:00
|
|
|
<?php
|
|
|
|
|
2015-12-29 07:10:24 +00:00
|
|
|
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-30 10:00:10 +00:00
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|