Jump to content

put swear filter where?


skbanta

Recommended Posts

You have 2 choices on filtering

 

A) you filter on the initial inputting happens once and as suggested saves CPU, however this means to recover the swear (if you want) you need to store it twice

 

B) You filter on presentation resulting in more CPU usage, bu you can make it more dynamic.                                                                                                                                                                                                                   

 

The amount of CPU usage on a simple filter isn't that much, but its the principle of it

Link to comment
Share on other sites

Well then you have to catch the message while it's being posted and replace the bad words.

If you make the replace everytime you open the page you might slow it down.

 

$_POST[message]= str_replace( $swears, '****', $_POST[message]);

$_POST[subject]= str_replace( $swears, '****', $_POST[subject]);

...

 

For the rest already posted make your self a loop programme that you will run only one time to replace all the bad stuff.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.