Hide "bad words" in all views that have values from database?
Hi guys.
Is there a way to hide all "bad words" or censor them with **** when loading them? Say for instance there are all commends and I don't want to do a regex or something else to censor a comment because I have over 50 views with different variables and data etc.
So if the bad word is "stupid" and the comment says "You are stupid", it will be "You are ******". Is there a way to do this with Laravel?
Only way I know how server side is to see if a word is in an array of bad words if true replace it. It's better performance wise to check on input to the data base.
Or use JavaScript to check a word after each spacebar press.
Or both.
Either way isn't going to be 100% but effort is there. Google around you can find lists of bad words as an array.