User tests: Successful: Unsuccessful:
Pull Request resolves #47219
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.xmlUse 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.
false.
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
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
| Title |
|
||||||
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:
Example values used:
"https://raw.githubusercontent.com/joomla/joomla-cms/5.4-dev/installation/localise.xml""\n " . $url . "\n"Observed:
true, whitespace falsetrue, whitespace trueI can paste the full local script content here if you want.
So maybe you need to update your test instructions
what script?