2015-12-23 14:54:03 +00:00
|
|
|
<?php
|
|
|
|
|
2015-12-29 07:10:24 +00:00
|
|
|
class NodeImageSanitizer extends NodeSanitizer {
|
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>' );
|
|
|
|
|
|
|
|
return $data;
|
|
|
|
}
|
2015-12-28 09:16:33 +00:00
|
|
|
|
|
|
|
protected function sanitizeElementData( $elementText, $allowedTags = null ) {
|
|
|
|
return $this->stripUnneededElements( parent::sanitizeElementData( $elementText, $allowedTags ) );
|
|
|
|
}
|
2015-12-23 14:54:03 +00:00
|
|
|
}
|