Re: Replacing with f*ck and f*cking
| From: | Larry Garfield | Date: | Sun, 26 Oct 2008 18:43:56 +0000 |
| Subject: | Re: Replacing with f*ck and f*cking | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-282457@lists.php.net to get a copy of this message | ||
On Sunday 26 October 2008 5:06:09 am Ashley Sheridan wrote:
> Obviously, this list could get pretty comprehensive, so like Andrew
> said, maybe you should look to see how some of the open source projects
> do it.
>
>
> Ash
> www.ashleysheridan.co.uk
The way Drupal handles such filtering is simple caching. As a policy we never
filter general content on save, because we may want to change the filter
format later and destroying user-submitted data is *not cool*. However, we
do apply a number of possible filters on display (add line breaks, convert
URLs to clickable, do "bad word" filtering, or any number of other things)
and then just cache the result. The cache lookup (based on a hash of the
string being filtered and the ID of the filter set to apply) is far faster
than reapplying the filters every time. We've found this mechanism to scale
very well.
--
Larry Garfield
larry@garfieldtech.com