Skip to content

Fix regex in DocumentRenderer.php #45592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 5.3-dev
Choose a base branch
from

Conversation

Technicalleigh
Copy link

@Technicalleigh Technicalleigh commented Jun 10, 2025

Pull Request for Issue # n/a

Summary of Changes

Fixes a regex to prevent double-slashes in the URLs for intro images used in RSS and Atom feeds

Testing Instructions

In the admin interface of a fresh Joomla installation:

  1. Admin: Open Menus > Main Menu and create a new menu item:
  • Title: test
  • Menu item type: Articles > Category List
  • Category: Uncategorised
  1. Admin: Create a new article:
  • Title: test page
  • Content: lorem ipsum
  • Intro image: /images/sampledata/cassiopeia/nasa1-1200.jpg
  1. Site: Click "test" in the Main Menu
  2. View page source to get the RSS or Atom feed URL
  3. Download the feed and open it in a text editor

Actual result BEFORE applying this Pull Request

<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>

Expected result AFTER applying this Pull Request

<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>

Link to documentations

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

Notes

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!

Fixes the regex to prevent double-slashes in RSS/Atom feed URLs for intro images.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants