News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SMF 2.0.14 Image Proxy - broken image is displayed

Started by Yariksat, May 15, 2017, 06:49:34 AM

Previous topic - Next topic

Yariksat

At me at initial loading the broken image is displayed, at repeated loading of page of the normal image.
File from the attachment is working properly?

Yariksat

Fixed the file from the update
At me earned normally

Shambles

Quote from: Yariksat on May 15, 2017, 08:33:07 AM
Fixed the file from the update

Could you explain why you changed "exit" to "$exit" on line 108 of proxy.php? Who advised you to do that?

Your "repair" also cured my image loading problem (offline forum) but I cannot understand why it works, following the throw of a 404.




Thanks.

Arantor

Um, what?

OK, the exit line was intentional! The proxy tried to get the image, it failed. The *correct* thing for it to do is to report the failure as a 404.
No good deed goes unpunished / All helpful urges should be circumvented

I have something to say: it's better to burn out than to fade away. There can be only one.

Yariksat

Quote from: Shambles on May 15, 2017, 12:51:52 PM
Quote from: Yariksat on May 15, 2017, 08:33:07 AM
Fixed the file from the update
Could you explain why you changed "exit" to "$exit" on line 108 of proxy.php? Who advised you to do that?
I do not even know who advised.
Somehow intuitively
The file that comes with the update does not work for me
404 - the picture is not there when you first load the page.
With this editing a file I have everything working.
If you know how to do it properly please.

Arantor

I'm still trying to figure out why it doesn't work - but I know that your change will make it work in various broken ways.

$exit; just won't do anything, it's a variable that doesn't exist and just evaluates to a null instruction (while also putting a warning in your server error log for a variable that doesn't exist) and the whole point of exiting when it does is because something has gone wrong and it is supposed to exit.
No good deed goes unpunished / All helpful urges should be circumvented

I have something to say: it's better to burn out than to fade away. There can be only one.

Shambles

@Arantor

In proxy.php, this throws a 404 (in the browser console) for all images processed, until the page is refreshed

$response = $this->checkRequest();
if (is_int($response)) {
// Throw a 404
header('HTTP/1.0 404 Not Found');
exit;
}


OP changed the exit; to $exit; and reports success, as do I.

What I wanted to know is why the $exit isn't throwing an error - is the script simply dropping through to some kind of completion?


EDIT: just seen your reply.

Advertisement: