Pending

User tests: Successful: Unsuccessful:

avatar Vikash-Kumar-23
Vikash-Kumar-23
15 Mar 2026

Pull Request resolves #47219

Summary of Changes

In Joomla\CMS\Changelog\Changelog::loadFromXml(), the incoming changelog URL is now trimmed before it is used.

This fixes cases where changelogurl in an extension manifest is formatted with surrounding whitespace (for example, written on a new line with indentation), which could cause changelog loading to fail.

Example manifest formatting that is now handled correctly:

https://example.com/changelog.xml

Testing Instructions

Use the commands below from the Joomla root. This does not require any extra script file.

PowerShell + Docker:

$p=(Get-Location).Path
$code = @'
define('_JEXEC', 1);
require 'includes/defines.php';
require 'includes/framework.php';

$container = Joomla\CMS\Factory::getContainer();
$container->alias('session', 'session.cli')
->alias('JSession', 'session.cli')
->alias(Joomla\CMS\Session\Session::class, 'session.cli')
->alias(Joomla\Session\Session::class, 'session.cli')
->alias(Joomla\Session\SessionInterface::class, 'session.cli');

Joomla\CMS\Factory::$application = $container->get(Joomla\Console\Application::class);

$url = 'https://raw.githubusercontent.com/joomla/joomla-cms/5.4-dev/installation/localise.xml';
$whitespaceUrl = PHP_EOL . ' ' . $url . PHP_EOL;

$c1 = new Joomla\CMS\Changelog\Changelog();
$c2 = new Joomla\CMS\Changelog\Changelog();

echo 'clean='; var_export($c1->loadFromXml($url)); echo PHP_EOL;
echo 'whitespace='; var_export($c2->loadFromXml($whitespaceUrl)); echo PHP_EOL;
'@
docker run --rm -v "${p}:/work" -w /work php:8.3-cli php -r "$code"

Run this once on a branch without this fix, then again with this PR branch.

Actual result BEFORE applying this Pull Request

image
  • The clean URL loads successfully.
  • The URL with leading/trailing whitespace fails and returns false.

Expected result AFTER applying this Pull Request

image
  • Both the clean URL and the URL with surrounding whitespace load successfully.

Link to documentation

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar Vikash-Kumar-23 Vikash-Kumar-23 - open - 15 Mar 2026
avatar Vikash-Kumar-23 Vikash-Kumar-23 - change - 15 Mar 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Mar 2026
Category Libraries
avatar richard67 richard67 - change - 15 Mar 2026
Title
Trim whitespace from changelog URL in Changelog::loadFromXml #47219
[5.4] Trim whitespace from changelog URL in Changelog::loadFromXml #47219
avatar richard67 richard67 - edited - 15 Mar 2026
avatar brianteeman
brianteeman - comment - 16 Mar 2026

Run the reproduction script before applying the fix and observe the result.

what script?

avatar Vikash-Kumar-23
Vikash-Kumar-23 - comment - 16 Mar 2026

I used a local helper script named repro_changelog_trim.php (not committed in this PR), only for manual reproduction.

Its purpose was to bootstrap Joomla CLI context and call Joomla\CMS\Changelog\Changelog::loadFromXml() twice:

  1. with a clean URL
  2. with the same URL wrapped in whitespace/newlines

Example values used:

  • clean:
    $url = "https://raw.githubusercontent.com/joomla/joomla-cms/5.4-dev/installation/localise.xml"
  • whitespace: "\n " . $url . "\n"

Observed:

  • before fix: clean true, whitespace false
  • with this PR: clean true, whitespace true

I can paste the full local script content here if you want.

avatar brianteeman
brianteeman - comment - 16 Mar 2026

So maybe you need to update your test instructions

avatar Vikash-Kumar-23 Vikash-Kumar-23 - change - 16 Mar 2026
The description was changed
avatar Vikash-Kumar-23 Vikash-Kumar-23 - edited - 16 Mar 2026

Add a Comment

Login with GitHub to post a comment