[5.4] [webservices] Fix API config component route: Component with numbers in name … 404 #46462
+2
−2
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.
Webservices API config component: Component with numbers in name get code 404 when using route path
v1/config/com_first2secondPull Request for Issue #45780.
Summary of Changes
The get and patch routes input restricts the component name. The input of component names were validated using
regex
[A-Za-z_]+. This excluded components with numbers in their name, such as j2xml or something2.The names are now tested by
[A-Za-z0-9_]+Testing Instructions
Attached is a bare component with config and menu
com_comp2test.zip
Install this component and use curl/postman with API path "v1/config/com_comp2test"
You should be familiar with Joomla API calls and Joomla tokens.
Actual result BEFORE applying this Pull Request
The get routes returns a 404
Expected result AFTER applying this Pull Request
The return of is a json text result. After changing the configuration value com_comp2test, it is also returned.
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
Please be patient, this is my first pull request