Search code examples
javascriptdhtmlx

DHTMLX with php form connector - How to not strip html on form save


DHTMLX frontend javascript library. I'm using input form tag with rows>1 attribute to edit some html. (On top of that textarea are powerful html editor). Loading is fine, I can see html tags as plain text in input, but after saving to database and reloading - all html tags are stripped. Is there a way to avoid it for some particular forms?

That html edited only by admin, no security risks to allow all html. It should be stored in db as plain html.

I look few existing answers, all about strip html, but I need non-striping, nor escaping.


Solution

  • I found a way for full form, could anybody help to do same for one particular field of form?

    <?php 
    require_once('../dx/connector/form_connector.php');
    ConnectorSecurity::$xss = DHX_SECURITY_TRUSTED;
    

    Above will be protected by .htaccess or php basic auth.