I have a form that is accepting URLs from users in PHP.
What characters should I allow or disallow? Currently I use
$input= preg_replace("/[^a-zA-Z0-9-\?\:#.()\,\/\&\'\\"]/", "", $string);
$input=substr($input,0,255);
So, it's trimmed to 255 chars and only can include letters, numbers, and ? - _ : # ( ) , & ' " /
Anything I should be stripping that I'm not, or anything I'm stripping that might need to be in a valid URL?