a space in the url brakes the link to the image.

Started by DenDen60, April 30, 2022, 07:27:26 AM

Previous topic - Next topic

DenDen60

I had a cartoon that I wanted to be published.

When I used this URL: 

https://citizensandsocieties.org/Community/images/cartoons/when workers unite.jpg

I could see the image in the message I was writing, but when I posted it, it wouldn't show. I would then click on modify, and I would see the image again. 

I tried changing the name of the file to

 "when_workers_unite.jpg", 

thus getting rid of the spaces, and it worked. I could see both the image as I was creating my message and after I posted it.  

Aleksi "Lex" Kilpinen

Spaces really shouldn't be used in web accessible files or folders. You can if you need to though, browsers should understand %20 as a space. For example:
https://citizensandsocieties.org/Community/images/cartoons/when%20workers%20unite.jpg
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

DenDen60

Quote from: Aleksi on April 30, 2022, 07:31:37 AMSpaces really shouldn't be used in web accessible files or folders. You can if you need to though, browsers should understand %20 as a space. For example:
https://citizensandsocieties.org/Community/images/cartoons/when%20workers%20unite.jpg
I understand. 

This being said, if a newbie, and my participants will be newbies, ;-) sees his image as he is  writing it in a post, then it disappears when he publishes it, he won't understand what happened.

From my point of view, either the software does not show an image when there are spaces in a URL when someone is writing a message ior it transforms spaces automatically into %20 when "Preview" or "Post" is clicked . 

Arantor

The software is doing the correct thing, it's not going to be changed, because it's not wrong.

Don't put spaces in the file names of your images in the first place.
Holder of controversial views, all of which my own.


DenDen60

Quote from: Arantor on April 30, 2022, 10:53:34 AMThe software is doing the correct thing, it's not going to be changed, because it's not wrong.

Don't put spaces in the file names of your images in the first place.
You are of course entitle to your opinion, and although you are technically right, when you make an analysis on the basis of user-friendliness, the software could be improved. 

shawnb61

Issue logged:
https://github.com/SimpleMachines/SMF2.1/issues/7441

Note this works fine in 2.0, but fails in 2.1. Not sure what changed.  Worth looking into.
A question worth asking is born in experience & driven by necessity. - Fripp

Aleksi "Lex" Kilpinen

Well, as As per RFC 1738 URLs must not contain literal spaces.
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

DenDen60

Quote from: Aleksi on April 30, 2022, 11:57:49 AMWell, as As per RFC 1738 URLs must not contain literal spaces.
Most users are not aware of  RFC 1738. ;-) Hence, since it is possible to transform a URL so that spaces are transformed into html code, wouldn't it be a good usability measure to automatically do this? I think it would, especially since users are able to see the image as they write their message even if the URL has spaces.   

Aleksi "Lex" Kilpinen

I agree it could be useful, if it can be easily achieved.
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

Geremia16

With SMF 2.1.1, I started getting the issue where URLs with spaces (not with "%20") are rendered as URLs with the spaces deleted. For example, the TestSite link of:
[url="https://testsite.com/Something with a space.html"]TestSite[/url]actually points to: TestSite [nofollow] (the URL with spaces deleted)

However,
[url="https://testsite.com/Something%20with%20a%20space.html"]TestSite[/url]works: TestSite [nofollow] (the URL with spaces retained)

Is there a way to rewrite all URLs so they have "%20" instead of spaces?

Geremia16

#10
With SMF 2.1.1, pasting rich-text with hyperlinks into the textarea then clicking the "Toggle source view" button strips all the hyperlinks. This didn't happen when I was running SMF 2.1 RC4, either.

"Toggle source view" strips hyperlinks in pasted rich-text #7455 [nofollow]


shawnb61

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

Advertisement: