SSP / Response JSON w/ HTML entities from database

SSP / Response JSON w/ HTML entities from database

akinatorrakinatorr Posts: 2Questions: 1Answers: 0
edited May 2017 in Free community support

Hello everyone,
I have a small question that make me crazy.

In my database, I have a table X that contains data with HTML entities (eacute; etc.)
When I use the SSP method, the JSON response returns the data correctly, the table displays it correctly (the entities are converted to normal text) BUT the search is problematic (if I enter the entity I see the results of my database which contain it, but if I type "é" I do not have them).
Is there no other way to change the search() method?

Thanks

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin
    Answer ✓

    Are they stored as HTML entities in the database? If so, your user would need to type the entity since the database will justbe doing a plain text search.

    Allan

  • akinatorrakinatorr Posts: 2Questions: 1Answers: 0

    With delay thanks for the reply,

    However I found a solution to my problem:
    In short, I have data in my database which has characters converted into HTML entities after using the PHP function htmlentities().
    The display of this data is perfect in the datatable, but when searching it is impossible to find data by entering accented characters, because they must be converted into HTML entities.
    Rather than changing the search () function and the value entered in the checkboxes,
    I used the customized SSP Class of emran (found on github) and which, in its ssp.customized.class class, contains the filter () method and where, before starting the search, I can convert the text entered with htmlentities(), then the returned data is OK.

    If it can help someone...

This discussion has been closed.