--- Patrick Bierans <[EMAIL PROTECTED]> wrote:
> > $photo = "This is a photo of my dog, Skippy!.jpg";
> > $funkychars = array('\'', '.', ',', '$', '!', ' ');
> > $photo = str_replace($funkychars, '_', $photo);
> > $photo = strtolower($photo);
>
> NOOOOOOOOOOOOOOOOOOOO*! (*= add some more O's for a more
> dramaturgical
> effect)
Here are a few more: 'OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO'...
> Do not say which chars you want to kill. There are always more chars
> than you can think of! Better say which chars you allow:
>
> $photo=preg_replace("/[^a-z9-0_\-]+/","",strtolower($photo));
>
> This technique is called "whitelist". "blacklist" techniques are not
> bulletproof.
Good to know. Thanks for correcting me on this!
-Bob
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/