Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Sachin Mane
Profanity check for wall posts.
June 26, 2012 8:47 PM
Answer

Sachin Mane

Rank: Junior Member

Posts: 76

Join Date: April 9, 2012

Recent Posts

Hello,

Is there any way we can implement profanity check for wall posts to remove bad words with something like %$$T^#?

Is there any open source library available which can be used?

Regards,
Sachin
Sandeep Nair
RE: Profanity check for wall posts.
June 26, 2012 10:06 PM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1692

Join Date: November 5, 2008

Recent Posts

You can achieve the same using Sanitizers in Liferay
Sachin Mane
RE: Profanity check for wall posts.
June 26, 2012 10:47 PM
Answer

Sachin Mane

Rank: Junior Member

Posts: 76

Join Date: April 9, 2012

Recent Posts

Thanks Sandeep.
I looked at the Sanitizers but there is no usesable OOTB SanitizerImpl in liferay. It just provides a hook where we have to write our own implementation.
The DefaultSanitizerImpl returns the original string back without any modifications.

Is there any ready made implementation available?

Regards,
Sachin.
Sachin Mane
RE: Profanity check for wall posts.
June 26, 2012 10:50 PM
Answer

Sachin Mane

Rank: Junior Member

Posts: 76

Join Date: April 9, 2012

Recent Posts

Okay. I think i will have to deploy antisamy hook and check if provides any Sanitizer impl.
Sandeep Nair
RE: Profanity check for wall posts.
June 27, 2012 12:50 AM
Answer

Sandeep Nair

Rank: Liferay Legend

Posts: 1692

Join Date: November 5, 2008

Recent Posts

Antisamy hook can be used as reference. You can also create your own santizer implementation class, by just setting the property in the hook
Sachin Mane
RE: Profanity check for wall posts.
June 27, 2012 2:17 AM
Answer

Sachin Mane

Rank: Junior Member

Posts: 76

Join Date: April 9, 2012

Recent Posts

I tried AntiSamy hook. but i think it is only meant to remove malicious code from the content and not for removing bad words.
If a custom sanitizer is to be implemented, i will have to refer to some repository of bad words. It also needs to be able to filter the content based on the context in which the word is used.

Something similar is required to filter out offensive images to be uploaded.