jaydipsavaliya / timthumb

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

timthumb does not work with dynamic php images generated from the same host #250

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have a php application that render images from DB using the url 
/getpicture.php?id=ABCDEFGHJ

Timthumb will not allow to fetch this images from the same server since there 
is a line of code stripping my hostname from the front of the src parameter.

Assuming $src='/getpicture.php?id=12345' i've tried to set the timthum.php?src= 
to
1. $src
2. http://myhost/$src
3. urlencode($src)
4. urlencode("http://myhost/$src")

The workaround is to comment out the following code around line 209:

if(preg_match('/https?:\/\/(?:www\.)?' . $this->myHost . '(?:$|\/)/i', 
$this->src)){
   $this->src = preg_replace('/https?:\/\/(?:www\.)?' . $this->myHost . '/i', '', $this->src);
}

Original issue reported on code.google.com by antonio....@gmail.com on 29 Aug 2011 at 1:00