[5.4] Fix invalid URL in Update Notification email when triggered via CLI#47303
Open
Reda-Muhamed wants to merge 2 commits intojoomla:5.4-devfrom
Open
[5.4] Fix invalid URL in Update Notification email when triggered via CLI#47303Reda-Muhamed wants to merge 2 commits intojoomla:5.4-devfrom
Reda-Muhamed wants to merge 2 commits intojoomla:5.4-devfrom
Conversation
Contributor
|
i don't think this is a solution |
Author
My main thought is that the CLI environment natively doesn't know the live site URL. If we rely on forcing users to manually add the --live-site parameter, we are completely trusting their input. If they forget it, or type an invalid domain by mistake, the system will still generate and email a broken link. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
When the Update Notification task (
plg_task_updatenotification) is triggered via the CLI without a--live-siteparameter,Uri::base()inherently falls back tohttps://joomla.invalid/set/by/console/application/. Because the plugin emails this raw output, it results in broken, confusing links for the user.This PR adds a safe language string fallback for the CLI environment. If the URL contains
joomla.invalid, the email will securely instruct the user to log in to their Administrator dashboard to apply the update, rather than sending a broken link.Testing Instructions
System - Joomla! Update Notificationplugin and its associated Scheduled Task are published.php cli/joomla.php scheduler:run -i 3Actual result BEFORE applying this Pull Request
The email body contains broken placeholder links:
URL:
https://joomla.invalid/set/by/console/application/Link:
https://joomla.invalid/set/by/console/application/administrator/index.php?option=com_joomlaupdateExpected result AFTER applying this Pull Request
The email body provides a clean, instructional fallback using the new language strings:
URL:
URL unavailable (Run via CLI without --live-site)Link:
Please log in to your site Administrator dashboard to apply this update.Link to documentations
No documentation changes required.
Fixes #47256