Advertisement:

Author Topic: 2.0.14 Image proxy does not process 'some' images  (Read 3088 times)

Online @rjen

  • Full Member
  • ***
  • Posts: 525
  • Gender: Male
2.0.14 Image proxy does not process 'some' images
« on: May 15, 2017, 04:22:56 PM »
After the upgrade I found that not all images are correctly showing with the image proxy!

So far I found problems with all images hosted at 'myalbum' and also links to some images in my website.

Bewlow the examples, showing that the same issue is in this forum...

After installing 2.0.14 I find multiple images are not showing anymore

Some tests below:

Links to 'mijnalbum' pages


Link is : [img ]http://www.mijnalbum.nl/Foto650-HZWWBE3J.jpg[/ img]
http://www.mijnalbum.nl/Foto650-HZWWBE3J.jpg

Links to images in the same site:


Link is : [im g width=200 height=150]http://www.fjr-club.nl/Documenten/Images/Modeljaren/2002deeppurplishblue.jpg[/im g]
http://www.fjr-club.nl/Documenten/Images/Modeljaren/2002deeppurplishblue.jpg
Running SMF 2.0 with Tinyportal 1.6.4 at www.fjr-club.nl
Testing SMF 2.1 RC2 with Tinyportal at http://test2.fjr-club.nl/

Online @rjen

  • Full Member
  • ***
  • Posts: 525
  • Gender: Male
Re: 2.0.14 Image proxy does not process 'some' images
« Reply #1 on: May 16, 2017, 03:15:47 AM »
Note: below example is an image which is on my server, that has moved to ssl a while ago.
There is a htaccess redirect active to redirect all http requests to https

The image link happens to be an ' old'  one: stil linking to http. The image is not showing in the old link when served via proxy, when I change the link to https it does show (but since it is no longer 'insecure' it bypasses the image proxy...
 
Original link


Https link


Needless to say I could go checking all links to images that can be changed to https, but that is something I am not willing to do. In my opinion the image proxy in SMF should work regardless the .htaccess redirect...

On an additional note: I just verified this in my 2.1 test installation: this problem does not occur there: so the 2.1 coding is ' better' .
Running SMF 2.0 with Tinyportal 1.6.4 at www.fjr-club.nl
Testing SMF 2.1 RC2 with Tinyportal at http://test2.fjr-club.nl/

Offline Gluz

  • Sr. Member
  • ****
  • Posts: 985
  • Gender: Male
Re: 2.0.14 Image proxy does not process 'some' images
« Reply #2 on: May 16, 2017, 03:39:08 AM »
Looks like the proxy is not handling well the redirections, 'cause the first image is redirected from an http link to its actual location that is https, so in theory it shouldn't need to use the proxy, but because the original link is not https the system use the proxy anyways.

That part is something that I don't understand form the code, and I hope someone of the Team can explain that, does the code proxy an image that is actually https from a redirection?
Need help with PHP, HTML, CSS, Themes or MODs?

Quote
Think in spanish, habla en inglés.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: 2.0.14 Image proxy does not process 'some' images
« Reply #3 on: May 16, 2017, 03:42:45 AM »
I don't think it handles the redirection at all, which is why it's a problem. If it handled redirections, it would proxy it because it's been invoked at that point.

The only other solution would be at post-save-time to check to see if it redirects to HTTPS and save it if it does.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Online @rjen

  • Full Member
  • ***
  • Posts: 525
  • Gender: Male
Re: 2.0.14 Image proxy does not process 'some' images
« Reply #4 on: May 16, 2017, 04:09:32 AM »
I would suggest to just 'proxy' these images: it may be overdoing it to check for redirects first.
What would be the issue using the proxy regardless?

I have been using a workaround proxy so far see: http://www.simplemachines.org/community/index.php?topic=527996.0, this way weserve just proxys the images regardless of the redirect to https.
On the other hand the 2.1 beta 3 code works fine for these images, so there is a working solution available apparently. I just do not know what the difference is...
Running SMF 2.0 with Tinyportal 1.6.4 at www.fjr-club.nl
Testing SMF 2.1 RC2 with Tinyportal at http://test2.fjr-club.nl/


Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,741
  • Gender: Male
    • Kindred-999 on GitHub
Re: 2.0.14 Image proxy does not process 'some' images
« Reply #6 on: May 16, 2017, 04:24:01 AM »
That "fix" is just plain wrong....
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Online @rjen

  • Full Member
  • ***
  • Posts: 525
  • Gender: Male
Re: 2.0.14 Image proxy does not process 'some' images
« Reply #7 on: May 16, 2017, 04:25:19 AM »
Does not seem to be the (exact) same : in this case the images are NEVER shown, refreshing does not make a difference.

I already saw that posting, but to me I do not see a definate fix there, just a discussion on a code change that may or may not work...
Running SMF 2.0 with Tinyportal 1.6.4 at www.fjr-club.nl
Testing SMF 2.1 RC2 with Tinyportal at http://test2.fjr-club.nl/

Offline Yariksat

  • Semi-Newbie
  • *
  • Posts: 47
Re: 2.0.14 Image proxy does not process 'some' images
« Reply #8 on: May 16, 2017, 04:32:22 AM »
That "fix" is just plain wrong....
At least he works for me.
A valid code is not working.
I do not pretend to be correct, the main thing for me is that my forum worked correctly until a correct solution is found.

Online @rjen

  • Full Member
  • ***
  • Posts: 525
  • Gender: Male
Re: 2.0.14 Image proxy does not process 'some' images
« Reply #9 on: May 16, 2017, 10:32:17 AM »
Just checked your 'fix'. but it does not help with the 'redirect' issue that causes the proxy not to work...
Running SMF 2.0 with Tinyportal 1.6.4 at www.fjr-club.nl
Testing SMF 2.1 RC2 with Tinyportal at http://test2.fjr-club.nl/

Offline SleePy

  • Let there be light!
  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,498
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: 2.0.14 Image proxy does not process 'some' images
« Reply #10 on: May 17, 2017, 09:04:23 PM »
Open $sourcedir/Class-CurlFetchWeb.php

Find:
Code: [Select]
$this->headers[strtolower($temp[0])] = strtolower(trim($temp[1]));

Replace:
Code: [Select]
$this->headers[strtolower($temp[0])] = trim($temp[1]);

Note, that this code may end up being the patched code in the next release.  If so, you would need to revert it prior to applying the next release.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 9,607
Re: 2.0.14 Image proxy does not process 'some' images
« Reply #11 on: May 17, 2017, 11:12:26 PM »
This forum does not allow me to change avatar with proxy enabled, image doesn't load.  Disabled proxy, changed it again, now it works.  Using Tor.


Online @rjen

  • Full Member
  • ***
  • Posts: 525
  • Gender: Male
Re: 2.0.14 Image proxy does not process 'some' images
« Reply #12 on: May 18, 2017, 01:36:03 AM »
Open $sourcedir/Class-CurlFetchWeb.php

Find:
Code: [Select]
$this->headers[strtolower($temp[0])] = strtolower(trim($temp[1]));

Replace:
Code: [Select]
$this->headers[strtolower($temp[0])] = trim($temp[1]);

Note, that this code may end up being the patched code in the next release.  If so, you would need to revert it prior to applying the next release.

That resolves this issue, indeed!

The one reported by Sir Osiris here remains though: Avatars previously uploaded show without problems, but changing is results in a broken avatar amage and a messages such as:

Quote
Not Found

The requested URL /eigenavatars/avatar_25_1495085439.png was not found on this server.

This happens with and without the proxy activated, and did not happen with 2.0.13. Another issue I presume?

 
Running SMF 2.0 with Tinyportal 1.6.4 at www.fjr-club.nl
Testing SMF 2.1 RC2 with Tinyportal at http://test2.fjr-club.nl/

Offline SleePy

  • Let there be light!
  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,498
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: 2.0.14 Image proxy does not process 'some' images
« Reply #13 on: May 18, 2017, 06:45:42 PM »
I can''t reproduce that.

I am guessing your using a custom avatar directory judging from the file path.  When I upload files it seems to work fine.  Did you update your urls for custom avatars and can php/apache write to that folder?
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Online @rjen

  • Full Member
  • ***
  • Posts: 525
  • Gender: Male
Re: 2.0.14 Image proxy does not process 'some' images
« Reply #14 on: May 19, 2017, 02:53:33 AM »
You guessed right . Thanks for checking I Will follow up in afbeelding days and respond back then
Running SMF 2.0 with Tinyportal 1.6.4 at www.fjr-club.nl
Testing SMF 2.1 RC2 with Tinyportal at http://test2.fjr-club.nl/

Offline stoneageman

  • Semi-Newbie
  • *
  • Posts: 23
Re: 2.0.14 Image proxy does not process 'some' images
« Reply #15 on: May 20, 2017, 04:21:30 PM »
I had the same problem with insecure images not showing if the proxy was enabled. The server was showing an suexec error for the proxy.php file. The file permission was set to 666. I changed this to 755 and now the http images are shown as secure on my https enabled site.

Online @rjen

  • Full Member
  • ***
  • Posts: 525
  • Gender: Male
Re: 2.0.14 Image proxy does not process 'some' images
« Reply #16 on: May 20, 2017, 05:03:18 PM »
File permissions were ok, but there was a problem with the URL on the custom avatar directory in my test forum. Problem solved
Running SMF 2.0 with Tinyportal 1.6.4 at www.fjr-club.nl
Testing SMF 2.1 RC2 with Tinyportal at http://test2.fjr-club.nl/