News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

[img] problem

Started by Sir Osis of Liver, January 10, 2024, 12:40:33 PM

Previous topic - Next topic

Sir Osis of Liver

One of my guys is having a problem viewing images that are posted in img tags.  It only affects him (admin) and some members.  The images are not displayed, and he can't link to them directly.  He's tried several browsers on different devices.  I can see the images in the posts and with direct links.  He posted a couple on my support forum, he can't see them but I can.  Oddly, Crocweb support can't see them either.  The images in the original post are posted like this:

[img]http://www.carsntrucks4you.de/images/crackerbox/GMC Crackerbox_1.jpg[/img]

Can you see it here?



Support tells me this:

The issue is caused by the SMF forum using https which causes the images to also be accessed using https protocol but those image URLs do not have SSL installed. This is not an issue with your SMF forum or the server. Please check the attached screenshot.

Screenshot attached.

Only unusual thing I've noticed is if I open image in new tab, url is displayed like this:

http://www.carsntrucks4you.de/images/crackerbox/GMC Crackerbox_1.jpg

But when I copy it from address bar it pastes like this:

http://www.carsntrucks4you.de/images/crackerbox/GMC%Crackerbox_1.jpg

I can view it either way.

Version Information:
Forum version: SMF 2.0.19 (more detailed)
Current SMF version: SMF 2.0.19
GD version: 2.3.3
Database Server: MariaDB
MySQL version: 10.6.15-MariaDB-cll-lve
PHP: 8.0.30
Server version: LiteSpeed
When in Emor, do as the Snamors.
                              - D. Lister

Aleksi "Lex" Kilpinen

A space is not a valid character in an url.
It should be http://www.carsntrucks4you.de/images/Crackerbox/GMC%20Crackerbox_1.jpg (Or preferably, it shouldn't have the space at all in the filename)



Also, you basically can not view HTTP content in a HTTPS webpage. Here, the image is proxied and presented as HTTPS.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Sir Osis of Liver

But it works for me as posted with the space.  I've posted it on my forum with the % replacing space, waiting for reply if he can see it.

How is it proxied?
When in Emor, do as the Snamors.
                              - D. Lister

Aleksi "Lex" Kilpinen

I just added this to my earlier post while you were replying.
Quote from: Aleksi "Lex" Kilpinen on January 10, 2024, 12:44:35 PMAlso, you basically can not view HTTP content in a HTTPS webpage. Here, the image is proxied and presented as HTTPS.
2.1 has the image proxy built in, there are mods for this as well.
https://custom.simplemachines.org/index.php?mod=4173
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Sir Osis of Liver

2.0 has an image proxy setting, when I enable it I can no longer see the images.
When in Emor, do as the Snamors.
                              - D. Lister

Aleksi "Lex" Kilpinen

Honestly can't remember if 2.0 had the same functionality already, but if turning it on breaks the images then something might not be working right.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

shawnb61

The 2.0 proxy was brought up to date with the 2.1 proxy fixes, etc., at one point.  The proxy should be good if you're on 2.0.19. 

What I see happening with that image, with the proxy OFF in 2.0, is a browser security warning.  Some browsers/settings will hide that image and note why in the console log.  That would explain why some folks can't see it with the proxy off.  That is expected behavior - with each release, all browsers are getting increasingly strict about mixed content.  To fix, they either need to lower their browser security settings, OR, add an exception for that site in their browser. 

With the proxy ON in 2.0, I see the pic served up properly, and no browser warning, as expected.  I'd double-check that you have the URL & spaces straightened out.
A question worth asking is born in experience & driven by necessity. - Fripp

Sir Osis of Liver

Can you see the image here?  Proxy is disabled, image is posted as [img]http://www.carsntrucks4you.de/images/crackerbox/GMC Crackerbox_1.jpg[/img].  I see it in FF 115, no security warning.  All security and privacy settings are maxed, Ghostery has no problem with it.  It displays correctly with space in file name in forum and with direct link.
When in Emor, do as the Snamors.
                              - D. Lister

shawnb61

#8
Yes, lots of security (and other) warnings & errors.
You cannot view this attachment.

The space isn't the problem - the insecure link is.

Although technically incorrect, 2.0 supported spaces in filenames under certain circumstances like this.  After discussion, we added that to 2.1 also - mainly because folks had images disappear on them after migration.  So now 2.1 will allow a space in there as well. 

A question worth asking is born in experience & driven by necessity. - Fripp

shawnb61

FYI, on Chrome & Edge, default install settings, that image doesn't appear. 
A question worth asking is born in experience & driven by necessity. - Fripp

Sir Osis of Liver

Any way to fix this for all users?  If image proxy is enabled, image doesn't display.

When in Emor, do as the Snamors.
                              - D. Lister

Sir Osis of Liver

Where did you get FF 121?  My browser is showing up to date at 115.6, no updates available.
When in Emor, do as the Snamors.
                              - D. Lister

Aleksi "Lex" Kilpinen

121.0 came in december, there's already a 121.0.1 released this month too.
You must be running Firefox Extended Support Release (ESR), that's stuck on 115.6 for now.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Sir Osis of Liver


Firefox is no longer supported on Windows 8.1 and below.

Crap.  >:(
When in Emor, do as the Snamors.
                              - D. Lister

Sesquipedalian

Quote from: Sir Osis of Liver on January 11, 2024, 03:14:10 PMAny way to fix this for all users?  If image proxy is enabled, image doesn't display.

The tests by everyone here demonstrate the opposite. (That's the whole point of the image proxy, after all.)

This means that on the forum where the image does not appear when the image proxy is enabled, there is most likely something going wrong with the image proxy on that particular server. Specifically, if the proxy script is unable save a local copy of the image to the cache, or unable to retrieve that local copy from the cache, then it will be unable to serve the image when requested.

I suggest that you start by checking file permissions and disk space in the ./cache/images directory (replacing ./cache with the correct path to the forum's cache directory, of course).
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Sir Osis of Liver

/cache/images is 755, plenty of disk space.  When I enable proxy image disappears, no file in cache.  Same with caching enabled or disabled.  Reposted several times with different cache settings, same thing.
When in Emor, do as the Snamors.
                              - D. Lister

Arantor

Quote from: Sir Osis of Liver on January 11, 2024, 03:45:46 PMFirefox is no longer supported on Windows 8.1 and below.

Crap.  >:(


I should add that we had the discussion, what, a year ago about the fact that Win8.1 was going out of support, that you wouldn't be getting the extended support (because that's reserved for the expensive customers) and that as a consequence, software was going to stop supporting it anyway because it's not worth it for their developers.

Windows 10 is 9 years old and goes out of regular support next year so Win8.1 is... getting on a bit.
Holder of controversial views, all of which my own.


Sir Osis of Liver

There are several reasons I haven't upgraded from 8.1 -

  • Win 10 and 11 are expensive.
  • Downloads are huge and MS servers are very slow.
  • Win 10 and 11 are expensive.
  • I like 8.1, it looks/works just like XP in Classic Shell.  I liked XP.
  • Win 10 and 11 are expensive.
  • Classic Shell is not available for Win 10/11.
  • Win 10 and 11 are expensive.
  • There's a good chance upgrade will crash my computer and make it a brick.

Did I mention Win 10 and 11 are expensive?

When in Emor, do as the Snamors.
                              - D. Lister

Illori

i bet if you tried you could use the same key you have for windows 8.1 and use it for windows 10 or 11.... i know mine for windows 7 worked fine for windows 10, so windows 10 cost me 0 extra dollars.

Sir Osis of Liver

Wouldn't have any idea where to find the key, and I believe MS ended free upgrades quite some time ago.  I had a MS support account, which might still entitle me to free upgrade, but they've locked the account.

But that's really beside the point.  I'm trying to fix this image problem for all users, I can see the posted pics fine. 

When in Emor, do as the Snamors.
                              - D. Lister

shawnb61

...But you cannot properly test & diagnose without a modern browser.  I'm not sure we can rely on your tests.

You need to figure out why the proxy isn't working for you.  For all we know, it's actually working. 

Once you use a current browser, and if you then still cannot see the image with the proxy on, you should look at your console log, apache log & web access log for clues.
A question worth asking is born in experience & driven by necessity. - Fripp

Sir Osis of Liver

Proxy is enabled here.  Do you see the image?
When in Emor, do as the Snamors.
                              - D. Lister

shawnb61

Quote from: shawnb61 on January 11, 2024, 05:02:13 PMOnce you use a current browser, and if you then still cannot see the image with the proxy on, you should look at your console log, apache log & web access log for clues.
A question worth asking is born in experience & driven by necessity. - Fripp

Sir Osis of Liver

FF 115 is a current browser.  Not the latest version, but it's less than a year old, they release updates every couple of months.  If I enable proxy on client site, images will not be viewable by many of the members.  Not everyone is using the latest versions of all hardware and software.  SMF should be able to accommodate a range of users with different browsers, and usually does.  This is the first time I've been presented with this problem.
When in Emor, do as the Snamors.
                              - D. Lister

Arantor

Quote from: Sir Osis of Liver on January 11, 2024, 05:04:38 PMProxy is enabled here.  Do you see the image?


No because the proxy.php requests give me a 404 response.
Holder of controversial views, all of which my own.


Sir Osis of Liver

I can see the posts on my desktop and tab, but images are missing.  Not getting 404.
When in Emor, do as the Snamors.
                              - D. Lister

Sesquipedalian

Whether the posts give a 404 is distinct from whether the image gives a 404.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Sesquipedalian

1. What value is set in the "Maximum file size of images to cache" setting?

2. Post a copy of proxy.php from the affected forum, so that someone can check whether it has been messed up.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Aleksi "Lex" Kilpinen

#28
Quote from: Sir Osis of Liver on January 11, 2024, 04:41:37 PMWouldn't have any idea where to find the key, and I believe MS ended free upgrades quite some time ago.
Yes, that must have been a couple of months ago already.  ::) It really truly was available for free, for years if upgrading in place from Windows 7 or Windows 8 to Windows 10, and is currently available from Windows 10 to Windows 11, even if previously upgraded from Windows 7 or 8.

https://www.zdnet.com/article/its-official-no-more-free-windows-10-upgrades/
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Arantor

Quote from: Sir Osis of Liver on January 11, 2024, 09:34:46 PMI can see the posts on my desktop and tab, but images are missing.  Not getting 404.


And if you open the image directly in the browser do you get a 404 because that's what I did. I never said the *posts* gave me a 404, because they don't.
Holder of controversial views, all of which my own.


Sir Osis of Liver

If I link directly to the image using the posted url the image is displayed correctly -

http://www.carsntrucks4you.de/images/crackerbox/GMC Crackerbox_1.jpg

The url doesn't work here because it's truncated at the space.

There is no broken image icon on desktop, it's blank.  There is on tab but wouldn't have any idea how to use it (just use tab for e-reader).  Neither displays images with proxy enabled.


When in Emor, do as the Snamors.
                              - D. Lister

Arantor

Yes, because proxy.php returns a 404, like I said.
Holder of controversial views, all of which my own.


Sir Osis of Liver

I'm seeing that in console, but it's a valid url.  If you link to it directly image loads.  And forum displays image (for me, anyway) if proxy is disabled.
When in Emor, do as the Snamors.
                              - D. Lister

Arantor

It's not a valid URL but never mind. It only works directly because the browser works around it for you - it's not legal in HTTP spec, hasn't even been if memory serves, because space is a restricted character.

The standard convention is to replace it with %20 exactly as my browser does before sending it off.

I'm not entirely sure why the proxy isn't doing that, but the behaviour it exhibits is otherwise actually correct - the space is not valid in the URL under any circumstances and standing there trying to say otherwise "because it works for you" is just irrelevant. It "works for you" the same way it works for me - the browser ignores what you tell it and corrects you.

It would be well within its rights to refuse you entirely.

If you were actually correct, Wikipedia wouldn't put underscores in all its URLs where there are spaces.
Holder of controversial views, all of which my own.


Sir Osis of Liver

So if I understand correctly, client would have to do two things to fix the problem:

- Advise members not to post links containing spaces (or other invalid characters).
- Enable image proxy to allow loading http images.

I've no way to test it, don't have an http site to store image.
When in Emor, do as the Snamors.
                              - D. Lister

Arantor

No-one should be posting links with spaces in BUT IF THEY DO the proxy should fix them the way the browser does, by replacing the space with %20 and fixing all the other exciting stuff in it with rawurlencode. The trick is to then manage to not *double* encode it when rewriting the link to have a link prefix.

This is ungodly difficult to do correctly which is why it doesn't work quite as it should because you have to fix the link, then fix the fix for the link because % is a special character, and then pray the webserver receiving it doesn't then try to be helpful and unwrap it one layer early.

Note that plenty of other systems don't like accepting URLs with spaces in for this exact reason, and the only reason the proxy even exists is because places aren't moving to HTTPS like they should already.
Holder of controversial views, all of which my own.


shawnb61

Just following up, I did confirm that the 2.0 proxy has an issue with http urls with embedded spaces, as SOoL reports.  2.1 works fine with the same URLs.
A question worth asking is born in experience & driven by necessity. - Fripp

Advertisement: