Feature PR-4.4-dev Pending

User tests: Successful: Unsuccessful:

avatar svanschu
svanschu
22 Feb 2024

Summary of Changes

Every statis:$base['path'] is prefixed with / except $_SERVER[] ones. This leads to URLs like

http://xyz.decli instead of http://xyz.de/cli

to be sure that this does not happen a check if static:$base['path'] is prefixed correctly bevor returning the base path is added.

This issue exists in J4 and J5

Testing Instructions

  • create a cli task
  • This cli task needs to use Route::link('site', 'index.php?SomeValidURL', true, true, true);
  • call the task with php cli/joomla.php scheduler:run -i <TASKID> --live-site 'http://localhost/'

Actual result BEFORE applying this Pull Request

Task#TASKID 'TASKNAME' exited with code 5 in 14.10 seconds.

Expected result AFTER applying this Pull Request

successful run

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

avatar svanschu svanschu - open - 22 Feb 2024
avatar svanschu svanschu - change - 22 Feb 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Feb 2024
Category Libraries
avatar richard67
richard67 - comment - 23 Feb 2024

@svanschu Will this PR here fix your issue #42859 ? If yes, then please mention it at the top of the PR before the Summary of Changes as shown in our PR template:

Pull Request for Issue #42859 (with a space after the issue number so GitHub will create a proper link).

And close the issue as we close issues when we have PRs to fix them.

Thanks in advance.

avatar svanschu
svanschu - comment - 23 Feb 2024

@richard67 no. As mentioned in the issue it is a different place which needs to be fixed.

avatar svanschu svanschu - change - 23 Feb 2024
Labels Added: PR-4.4-dev
avatar HLeithner
HLeithner - comment - 24 Apr 2024

It's more readable to use ltrim($path, '/') . '/' ... also reduces the if a / exists

avatar HLeithner HLeithner - change - 24 Apr 2024
Title
fix missing / in url Route:link on cli
[4.4] fix missing / in url Route:link on cli
avatar HLeithner HLeithner - edited - 24 Apr 2024
avatar svanschu svanschu - change - 18 Jun 2024
Labels Added: Feature
avatar svanschu
svanschu - comment - 18 Jun 2024

It's more readable to use ltrim($path, '/') . '/' ... also reduces the if a / exists

I've done the requested change @HLeithner

avatar HLeithner
HLeithner - comment - 15 Nov 2024

This pull request has been automatically rebased to 5.3-dev.

Add a Comment

Login with GitHub to post a comment