User tests: Successful: Unsuccessful:
Pull Request for Issue #46131
Fixes a regex to prevent double-slashes in the URLs for intro images used in RSS and Atom feeds
In the admin interface of a fresh Joomla installation:
<description><![CDATA[<p><img src="https://example.com//images/sampledata/cassiopeia/nasa1-1200.jpg" alt="" width="1200" height="400" loading="lazy"></p><p>lorem ipsum</p>]]></description>
<description><![CDATA[<p><img src="https://example.com/images/sampledata/cassiopeia/nasa1-1200.jpg" alt="" width="1200" height="400" loading="lazy"></p><p>lorem ipsum</p>]]></description>
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
I couldn't figure out why this happens for the Intro Image but not any other images in an article. I only happened to notice it because the RSS reader I use doesn't try to fix malformed URLs. :) I did some additional testing to ensure my fix doesn't interfere with any other links in the feed -- it looks good to me, but I'm no expert so please check closely.
Thank you for all your work on this project!
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
| Labels |
Added:
PR-5.3-dev
|
||
| Title |
|
||||||
@Technicalleigh Hi there, I confirm that there is no double / thanks to your PR, but unfortunately for me on one of my test sites, it's not working 100%. I think it is perhaps because I am running Joomla from a sub-folder (one of my testing environments is setup as such on purpose)...
Yes, that's a totally separate issue from this regex. I think you'd need to look into the function called to set the '$base' variable on line 76.
| Labels |
Added:
bug
|
||
This pull request has been automatically rebased to 5.4-dev.
| Title |
|
||||||
| Labels |
Added:
PR-5.4-dev
Removed: PR-5.3-dev |
||
I have tested this item ✅ successfully on c1e12db
Had a problem with a site which had multiple RSS feeds. Tested on the live site and problem is fixed.
I have tested this item ✅ successfully on c1e12db
| Status | Pending | ⇒ | Ready to Commit |
| Build | 5.3-dev | ⇒ | 5.4-dev |
RTC
| Labels |
Added:
RTC
|
||
Final test before merge with JBT
gh pr checkout 45592img src URL doubled slashes are reduced to one, nothing else changed (checked with char comparisation e.g. git diff --no-index --color --word-diff --word-diff-regex=. rMQ44jik WsWryuaj)git switch -img src URL doubled slashes are reduced to one, nothing else changed <link rel="self" type="application/atom+xml" href="http://localhost:7054//index.php?format=feed&type=atom"/>
@Technicalleigh is this doubled slash easy to fix and related to this PR? Then I will wait, else I can merge this PR and create an issue.
@muhme Only the image URL's are controlled in this file. I also noticed the other double slashes. An other thing I noticed is that when Joomla is installed in a sub folder, the sub folder name gets added two times in the atom/rss URL. Maybe we have to address this in a separate PR.
| Status | Ready to Commit | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-12-09 15:59:38 |
| Closed_By | ⇒ | muhme |
Thank you @Technicalleigh for your contribution. Thank you @RickR2H and @KasperHeuer for testing. Thank you @exlemor and @Aaqilyousuf for supporting this PR.
I will create an issue for link rel="self" href doubled slashes. @Aaqilyousuf or @exlemor could one of you create one for subfolder doubled slashes?
@Technicalleigh Hi there, I confirm that there is no double / thanks to your PR, but unfortunately for me on one of my test sites, it's not working 100%. I think it is perhaps because I am running Joomla from a sub-folder (one of my testing environments is setup as such on purpose)...
BEFORE PATCH:
https://www.mydomain.com/_j532//_j532/images/sampledata/cassiopeia/nasa1-1200.jpg
AFTER PATCH
https://www.mydomain.com/_j532/_j532/images/sampledata/cassiopeia/nasa1-1200.jpg
(but neither show the image of course even though what I expect:
https://www.mydomain.com/_j532/images/sampledata/cassiopeia/nasa1-1200.jpg does show the image).