#59 External Image Retrieval Failed



I used phpThumb along with autothumb in as a wordpress plugin. I experienced error in retrieving external image from other sites. The error was:
"403 Forbidden"

I tried to trace the error source, and found out that the source of the error is because the URL has been altered. In my case, the url didn't have any query or what soever. It's a seems to be a static image, that in the code, it was added with a "?" letter.
Finally, I can resolve it by adding a condition that if the URL has no query, I will append nothing. The changed file was phpthumb.functions.php on line 746 for the last beta file I found in this project. I suggest this change:

$rawData = phpthumb_functions::URLreadFsock(@$parsed_url['host'], @$parsed_url['path'].(@$parsed_url['query'] ? '?'.@$parsed_url['query'] : ''),, $errstr, true, (@$parsed_url['port'] ? @$parsed_url['port'] : 80), $timeout);

Since I don't know yet how to do editing on the project source code, I thought of using svn or git, but I couldn't find one, so I include the file in this report.

Thank you for making a great code.



  • Hidayat Febiansyah

    sorry.. extra comma was added. Here is the correct form:

    $rawData = phpthumb_functions::URLreadFsock(@$parsed_url['host'], @$parsed_url['path'].(@$parsed_url['query'] ? '?'.@$parsed_url['query'] : ''), $errstr, true, (@$parsed_url['port'] ? @$parsed_url['port'] : 80), $timeout);


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks