PortableInfobox/services/Sanitizers/NodeImageSanitizer.php
Sebastian Marzjan 168bf09348 DAT-3621 Unified tests for hero image and regular caption
* Disable sanitization on Oasis
* Handle previously unsupported case of nested tag ( <b><a></a></b> )
* Unify test formatting
* Change list handling (yes, I am not proud of that)
2016-01-12 09:21:21 +01:00

21 lines
559 B
PHP

<?php
class NodeImageSanitizer extends NodeSanitizer {
protected $allowedTags = [ 'a' ];
protected $selectorsWrappingTextToPad = [ 'li' ];
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;
}
}