I've got a PHP/MySQL combo that (on the back end) uploads user-submitted JPEG files to a directory, writes the filename into the database, then (on the front end) retrieves the filename into a javascript array and then displays it as the user works through a slideshow.
I've currently limited my filenames to A-Za-z0-9_~ (1-24 characters) plus ".jpg" or ".JPG". I notice that Adobe Imageready tends to generate jpegs with hyphens in the name (for instance, when creating a mouseover, "image.jpg" and "image-over.jpg").
Are there any known risks with having a hyphen (which could conceivably be interpreted as a minus sign) in a filename in PHP, MySQL or Javascript?