do not strip links

This commit is contained in:
dianafa 2015-11-03 16:12:44 +01:00
parent 569ef4ae4c
commit 3f2d287e8a

View file

@ -58,7 +58,7 @@ class PortableInfoboxRenderServiceHelper {
if ( $type === 'title' ) {
$data[ 'value' ] = $this->sanitizeElementData( $data[ 'value' ] );
} else if ( $type === 'data' ) {
$data[ 'label' ] = $this->sanitizeElementData( $data[ 'label' ] );
$data[ 'label' ] = $this->sanitizeElementData( $data[ 'label' ], '<a>' );
} else if ( $type === 'hero-mobile' ) {
$data[ 'title' ][ 'value' ] = $this->sanitizeElementData( $data[ 'title' ][ 'value' ] );
}
@ -72,9 +72,9 @@ class PortableInfoboxRenderServiceHelper {
* @param $elementData
* @return string
*/
private function sanitizeElementData( $elementData ) {
private function sanitizeElementData( $elementData, $allowedTags = '' ) {
if (!empty( $elementData )) {
$elementData = trim( strip_tags( $elementData ) );
$elementData = trim( strip_tags( $elementData, $allowedTags ) );
}
return $elementData;
}