Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Yarik1980 on May 15, 2017, 06:49:34 AM

Title: SMF 2.0.14 Image Proxy - broken image is displayed
Post by: Yarik1980 on May 15, 2017, 06:49:34 AM
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?
Title: Re: SMF 2.0.14 Image Proxy - broken image is displayed
Post by: Yarik1980 on May 15, 2017, 08:33:07 AM
Fixed the file from the update
At me earned normally
Title: Re: SMF 2.0.14 Image Proxy - broken image is displayed
Post by: 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?

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

(http://i.imgur.com/Hf2Y0Tf.png)


Thanks.
Title: Re: SMF 2.0.14 Image Proxy - broken image is displayed
Post by: Arantor on May 15, 2017, 12:59:05 PM
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.
Title: Re: SMF 2.0.14 Image Proxy - broken image is displayed
Post by: Yarik1980 on May 15, 2017, 01:13:37 PM
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.
Title: Re: SMF 2.0.14 Image Proxy - broken image is displayed
Post by: Arantor on May 15, 2017, 01:18:25 PM
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.
Title: Re: SMF 2.0.14 Image Proxy - broken image is displayed
Post by: Shambles on May 15, 2017, 01:22:38 PM
@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.