Welcome! » Log In » Create A New Profile

How Can I use css attributes

Posted by krasho 
How Can I use css attributes
November 14, 2016 10:39AM

Hello.

I want to create this DIV

<div style="display: flex">
  <p> testing </p>
</div>

When I save the data I use this function:

function sanitizeDataWithHtmlpurifier($data)
{
	require_once "vendor/htmlpurifier/library/HTMLPurifier.auto.php";

	$config = HTMLPurifier_Config::createDefault();
	$purifier = new HTMLPurifier($config);
	return $purifier->purify($data);

}

Te result after use te function is:

<div style="display: flex">
  <p> testing </p>
</div>

How Can I create a special filter or to allow use this tag?

Thanks

Re: How Can I use css attributes
November 14, 2016 11:01AM

HTML Purifier's rule for 'display' doesn't support flex. You'll have to override the CSS (get a copy of CSSDefinition and then override the display definition; look at CSSDefinition.php for ideas).

Sorry, you do not have permission to post/reply in this forum.