oseawey / timthumb

Automatically exported from code.google.com/p/timthumb
0 stars 0 forks source link

URL Validation Fails on Some Valid URLs #169

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to use TimThumb with the URL 
http://a1061.g.akamai.net/7/1061/5412/home/www.walgreens.com/dbimagecache/603531
18000_450x450_a.jpg

What is the expected output? What do you see instead?
This is a valid URL, but it fails the TimThumb Regex for URL validation.

I think the URL validation Regex needs to be expanded. Here's a good writeup at 
StackOverflow on more comprehensive URL validation:
http://stackoverflow.com/questions/161738/what-is-the-best-regular-expression-to
-check-if-a-string-is-a-valid-url

Either that, or maybe instead of regex for validation, php actually checks to 
see if the file is real and an image file.

Original issue reported on code.google.com by starkf...@gmail.com on 8 Mar 2011 at 1:58

GoogleCodeExporter commented 9 years ago
Facing same issue specially when using timthumb with vimeo videos thumbnails 
working fine with youtube video thumbnails because youtube thumbnails got a 
simple and short url as compare to vimeo long url's

Original comment by ad...@mobiledosti.net on 10 Mar 2011 at 12:31

GoogleCodeExporter commented 9 years ago
Changed the validation regex. Works for all of my test urls.

Original comment by BinaryMoon on 4 Apr 2011 at 8:28