ferenznetworks / timthumb

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

External Link Usage !! #39

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. using wordpress. and copy entire posts with the original images links.
2. when my theme use timthumb.php to generate resized copies.
3. it stops because we have "http" external links.

What is the expected output? What do you see instead?
i want to check $src -the link- and redirecting it to external links
resizer function else use the local.

Original issue reported on code.google.com by ismaeel....@gmail.com on 4 Sep 2009 at 5:50

GoogleCodeExporter commented 8 years ago
I may have a fix for you, but first let me describe what this will/won't work 
on:

Your script will not work cross-domain (meaning you can't link to an image that 
is on
a different server than the script).

However, if you're trying to do something like this: 
http://yoursite.com/timthumb.php?src=http://www.yoursite.com/image.png

Then apply this:

// sort out image source
$src = get_request("src", "");

// remove the http://....com and replace with a relative "/" to root directory
$src = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*?)?)?)@', '/', 
$src);

Original comment by clay.mci...@gmail.com on 2 Dec 2009 at 12:52

GoogleCodeExporter commented 8 years ago
Please help me. i can't use remote link to my site. i make tihs but can't work? 
how
to make this. sorry my bad english :)

Original comment by halilibr...@gmail.com on 26 Dec 2009 at 2:49

GoogleCodeExporter commented 8 years ago
please test the latest version of the script. Previously this was not possible 
but it
has now been allowed for certain domains (flickr.com etc)

Original comment by BinaryMoon on 31 Dec 2009 at 7:15

GoogleCodeExporter commented 8 years ago
I've tried the beta version, but still won't work. I'm using Google App Engine 
as
CDN, and I've added the domain to the beta file, but it doesn't work.

Original comment by ivan.tam...@gmail.com on 7 Jan 2010 at 3:49