Foros de discusión

How to filter webcontent before it gets to browser in 6.1

thumbnail
Clint Wilde, modificado hace 7 años.

How to filter webcontent before it gets to browser in 6.1

Junior Member Mensajes: 39 Fecha de incorporación: 5/03/13 Mensajes recientes
Is there a way to create a hook, filter, etc, so I can filter any and all web content before it gets to the browser ?

Basically, after web content is pulled from the DB, I need to look for certain characters replace it with other chars before it gets to the browser.

Thanks in advance,
Clint
thumbnail
Olaf Kock, modificado hace 7 años.

RE: How to filter webcontent before it gets to browser in 6.1

Liferay Legend Mensajes: 6396 Fecha de incorporación: 23/09/08 Mensajes recientes
Clint Wilde:
Basically, after web content is pulled from the DB, I need to look for certain characters replace it with other chars before it gets to the browser.

Well, there are ModelListeners and overridden Services.

However, I suspect that the problem is better solved by (once and for all) processing all content, storing it correctly to the database and forget about it. The only reason for this requirement that comes to my mind involves messed up encoding on some level - and this would better be fixed sooner than later.

You might also want to look into content sanization (e.g. used by the AntiSamy hook, but you can write such a service yourself) for making sure that only legal content ends up in the database.