mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-16 04:22:37 +00:00
22 lines
475 B
PHP
22 lines
475 B
PHP
<?php
|
|
|
|
class NodeDataSanitizer extends NodeSanitizer {
|
|
/**
|
|
* @desc remove all HTML tags but links from data labels.
|
|
* If label after sanitization became empty because contained only image
|
|
* do not sanitize it.
|
|
*
|
|
* @param $data
|
|
* @return mixed
|
|
*/
|
|
public function sanitize( $data ) {
|
|
$sanitizedLabel = $this->sanitizeElementData( $data[ 'label' ], '<a>' );
|
|
|
|
if ( !empty( $sanitizedLabel) ) {
|
|
$data[ 'label' ] = $sanitizedLabel;
|
|
}
|
|
|
|
return $data;
|
|
}
|
|
}
|