mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-16 04:22:37 +00:00
168bf09348
* 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)
24 lines
703 B
PHP
24 lines
703 B
PHP
<?php
|
|
|
|
class NodeHeroImageSanitizer extends NodeSanitizer {
|
|
protected $allowedTags = [ 'a' ];
|
|
protected $selectorsWrappingTextToPad = [ 'li' ];
|
|
protected $selectorsWrappingAllowedFeatures = [ 'sup[@class="reference"]' ];
|
|
protected $selectorsForFullRemoval = [ 'script', 'span[@itemprop="duration"]' ];
|
|
|
|
/**
|
|
* @param $data
|
|
* @return mixed
|
|
*/
|
|
public function sanitize( $data ) {
|
|
if ( !empty( $data[ 'title' ][ 'value' ] ) ) {
|
|
$data[ 'title' ][ 'value' ] = $this->sanitizeElementData( $data[ 'title' ][ 'value' ] );
|
|
}
|
|
if ( !empty( $data[ 'image' ][ 'caption' ] ) ) {
|
|
$data[ 'image' ]['caption'] = $this->sanitizeElementData( $data[ 'image' ]['caption'] );
|
|
}
|
|
|
|
return $data;
|
|
}
|
|
}
|