Feature PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
14 Nov 2024

Summary of Changes

This PR implements a flag in the router to mark parsed URLs as tainted. A tainted URL was able to be parsed, but has errors, for example it is missing the suffix or in a site with enabled IDs the alias of an article is wrong. In those cases the URL could be parsed, but it isn't the correct URL. In that cases we don't have to throw a 404, but can redirect to the correct URL. This is implemented in the SEF system plugin here as well, doing a 301 redirect when the URL is marked as tainted. The benefit is, that we prevent multiple redirects when more than one thing is wrong with the URL (for example missing suffix AND wrong alias for an ID)

This PR was made possible by the support of djumla. Thank you for that.

Testing Instructions

Codereview

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: joomla/Manual#330

  • No documentation changes for manual.joomla.org needed

avatar Hackwar Hackwar - open - 14 Nov 2024
avatar Hackwar Hackwar - change - 14 Nov 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Nov 2024
Category Libraries Front End Plugins
avatar Hackwar Hackwar - change - 15 Nov 2024
Labels Added: Feature PR-5.3-dev
avatar brianteeman
brianteeman - comment - 18 Nov 2024

Just to make sure I understand this correctly.

This would **for example ** detect this url https://brian.teeman.net/joomla/906-full-width-potatoes and do a 301 redirect to https://brian.teeman.net/joomla/906-full-width-joomla-modules

avatar Hackwar
Hackwar - comment - 18 Nov 2024

Correct. And if you disable IDs, it would automatically redirect to brian.teeman.net/joomla/full-width-joomla-modules

avatar Hackwar
Hackwar - comment - 18 Nov 2024

Correction: This PR together with #44477 would do that.

avatar brianteeman
brianteeman - comment - 18 Nov 2024

Thanks for confirming. Will be able to test these two pr correctly now

avatar brianteeman brianteeman - test_item - 19 Nov 2024 - Tested successfully
avatar brianteeman
brianteeman - comment - 19 Nov 2024

I have tested this item ✅ successfully on 7d9e478

tested together with #44477
manually typed this url in my browser https://brian.teeman.net/joomla/906-full-width-potatoes.html and it did a 301 redirect to https://brian.teeman.net/joomla/906-full-width-joomla-modules


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44455.

avatar Hackwar Hackwar - alter_testresult - 20 Nov 2024 - brianteeman: Tested successfully
avatar SniperSister SniperSister - test_item - 21 Nov 2024 - Tested successfully
avatar SniperSister
SniperSister - comment - 21 Nov 2024

I have tested this item ✅ successfully on 51f23a9

Tested via both, code review and testing the patch together with #44477


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44455.

avatar Hackwar Hackwar - change - 21 Nov 2024
Status Pending Ready to Commit
avatar Hackwar
Hackwar - comment - 21 Nov 2024

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44455.

Add a Comment

Login with GitHub to post a comment