掲示板

How to filter webcontent before it gets to browser in 6.1

thumbnail
7年前 に Clint Wilde によって更新されました。

How to filter webcontent before it gets to browser in 6.1

Junior Member 投稿: 39 参加年月日: 13/03/05 最新の投稿
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
7年前 に Olaf Kock によって更新されました。

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

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
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.