'&' symbol NOT as & amp

'&' symbol NOT as & amp

antonis80antonis80 Posts: 18Questions: 8Answers: 0
edited November 2016 in Free community support

I am using the PHP Editor and whenever the values of any of the input fields to be submitted in a MYSQL table contain the '&' symbol it is then inserted as "& amp" i want to avoid this so as to avoid the hasle of "addlsashes" and "htmlentities" any advice will really help!! thank you

Answers

  • antonis80antonis80 Posts: 18Questions: 8Answers: 0

    For anyone interested solved it with the following:

    ->getFormatter( function ( $val, $data, $opts ) { return htmlspecialchars_decode($val);} )
    ->setFormatter( function ( $val, $data, $opts ) { return htmlspecialchars_decode($val);} ),

  • allanallan Posts: 63,823Questions: 1Answers: 10,517 Site admin

    This is part of Editor's XSS protection. Because DataTables doesn't encode HTML when writing it into the DOM automatically (although there is a renderer for that), Editor stores the data in the safe format. You can use the ->xss( false ) method to disable that.

    Then use this renderer to make sure you are still safe from XSS.

    Allan

This discussion has been closed.