Bug #91040
closedRequestBuilder fails merging params
100%
Description
If the plugin namespace param is not an array, RequestBuilder will fail.
This should not happen.
Example URL:
http://example.ddev.site/search?id=123&tx_solr=foo+bar
Error:
(1/1) TypeError Argument 1 passed to TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule() must be of the type array, string given, called in /var/www/html/web/typo3/sysext/extbase/Classes/Mvc/Web/RequestBuilder.php on line 172
I guess any call like ?plugin_ns=foo instead of ?plugin_ns[xyz]=foo will cause the error.
Updated by Alexander Schnitzler over 4 years ago
- Status changed from New to Needs Feedback
- Priority changed from Should have to -- undefined --
First of all you are right. Any call like ?plugin_ns=foo
will cause this error. Question is: Why are you using the namespace argument like that? You referred to ext solr. What is the purpose of using ?tx_solr=foo+bar
?
Updated by Remo H. over 4 years ago
Alexander Schnitzler wrote:
First of all you are right. Any call like
?plugin_ns=foo
will cause this error. Question is: Why are you using the namespace argument like that? You referred to ext solr. What is the purpose of using?tx_solr=foo+bar
?
A client reported issues with this kind of link, no Idea from where he got a link like this.
It's just an example. I dont use namespace like this in own extensions.
The issue is, that it is possible to raise an error with invalid arguments.
Updated by Alexander Schnitzler over 4 years ago
The issue is, that it is possible to raise an error with invalid arguments.
Adding namespaced arguments to a URL will trigger Extbase to evaluate them. So, what should Extbase do here instead of throwing an Exception in your opinion?
Updated by Remo H. over 4 years ago
Since Extbase expects an array, I think best would be do a type check. If argument is not an array then simply ignore it.
Updated by karlheinz schmidt over 4 years ago
Suggestion:
TYPO3\CMS\Extbase\Mvc\Web\Requestbuilder Row 172:
if ($typo3Request instanceof ServerRequestInterface) {
$queryArguments = $typo3Request->getAttribute('routing');
if ($queryArguments instanceof PageArguments) {
$getParameters = $queryArguments->get($pluginNamespace) ?? [];
} else {
$getParameters = $typo3Request->getQueryParams()[$pluginNamespace] ?? [];
}
if (!is_array($getParameters)) {
$getParameters = [];
}
$bodyParameters = $typo3Request->getParsedBody()[$pluginNamespace] ?? [];
$parameters = $getParameters;
ArrayUtility::mergeRecursiveWithOverrule($parameters, $bodyParameters);
} else {
$parameters = \TYPO3\CMS\Core\Utility\GeneralUtility::_GPmerged($pluginNamespace);
}
Updated by Gerrit Code Review over 4 years ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65351
Updated by Gerrit Code Review about 4 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65351
Updated by Gerrit Code Review about 4 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65351
Updated by Gerrit Code Review over 3 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68936
Updated by Gerrit Code Review over 3 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65351
Updated by Gerrit Code Review over 3 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65351
Updated by Gerrit Code Review over 3 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65351
Updated by Gerrit Code Review over 3 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65351
Updated by Remo H. over 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 74dce1f4832508a1c7fc9eeb05f5b2589b2a9dbc.
Updated by Gerrit Code Review over 3 years ago
- Status changed from Resolved to Under Review
Patch set 2 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68936
Updated by Gerrit Code Review over 3 years ago
Patch set 3 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68936
Updated by Gerrit Code Review over 3 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68988
Updated by Gerrit Code Review over 3 years ago
Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68988
Updated by Gerrit Code Review over 3 years ago
Patch set 3 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68988
Updated by Remo H. over 3 years ago
- Status changed from Under Review to Resolved
Applied in changeset d8592f5d8255c6a8a25ffe6db9b3f47584c4836d.