I upgraded today (15 Feb 2022) from SMF 2.0.19 to 2.1.1
In the body of a post I have an image tag
[img]https://www.dav-bw-forum.de/panorama2022/2022_02_13 Seeg - 3-Seen-Tour/0213-120534.jpg[/img]
The rendered page does not display the image because the resulting html is:
<img src="https://www.dav-bw-forum.de/panorama2022/2022_02_13Seeg-3-Seen-Tour/0213-120556_stitch.jpg" alt="" class="bbc_img resized" loading="lazy" width="1024" height="164">
The spaces in the directory are gone :(
See the result for yourself at
https://www.dav-bw-forum.de/forum/index.php?topic=958
Spaces are generally a really bad idea in URLs - I'd honestly suggest renaming your files to something without them.
Spaces in directory names can even cause issues with directories in Windows on desktop, let alone running live on the web. Why would you put spaces in directory names? Use underscores, or hyphens. That's standard practice.
You would need to replace spaces with %20 to make it work
example:
[img]https://www.dav-bw-forum.de/panorama2022/2022_02_13%20Seeg%20-%203-Seen-Tour/0213-120534.jpg[/img]
But like already mentioned, it's simply better to just avoid spaces to begin with.
Hi all,
The workaround with %20 instead a space works
Thank you.
But I can't edit all my posts.
Reverting the behaviour to SMF 2.0 style bbcode isn't really viable either (because it breaks in other subtle ways if you're not careful and even if you are)
Quote from: ForumKlaus on February 15, 2022, 04:51:25 PMHi all,
The workaround with %20 instead a space works
Yes, it will work, but it's messier and more difficult to read, and it also means more superfluous characters. Which is why people use underscore and/or hyphens. Easier to type, less clutter, easier to read.
QuoteBut I can't edit all my posts.
You can run an SQL query on the database, to find and replace all instances of the relevant directory names.
Btw, this is called URL- or Percent-Encoding (https://en.wikipedia.org/wiki/Percent-encoding) and has nothing to do with SMF. It's just part of the rules of how URLs (simplified: web links) have to look like.
Yes but previously SMF handled this very slightly differently such that the original use case - while not recommended at all - would actually work. This has been changed for unrelated reasons in SMF and now breaks, but reverting the specific change is difficult to do and the correct approach is to make the folder names normalised.
Since the code removes the spaces all that would need to happen is rename the folders to match...