Bug #88125

HttpUtility::buildQueryString doesn't seem to be proper for additionalParams

Added by Dirk Wildt 8 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2019-04-10
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

AbstractPlugin->pi_linkTP() is using the Method HttpUtility::buildQueryString for rendering additionalParams.
This causes a bug, additionalParams won't rendered any longer.

HttpUtility::buildQueryString returns for example: &%5Btx_xblog_pi1%5Bplugin%5D%5D=732
But the proper rezurn must be for example: &tx_xblog_pi1[plugin]=732

If you replace HttpUtility::buildQueryString( $urlParameters, '&', true ) with GeneralUtility::implodeArrayForUrl( '', $urlParameters, '', true ) everything runs fine.
TYPO3 8.7 has used GeneralUtility::implodeArrayForUrl.

class: TYPO3\CMS\Frontend\Plugin\AbstractPlugin
function: pi_linkTP($str, $urlParameters = [], $cache = false, $altPageId = 0)

Kind regards
Dirk

History

#1 Updated by Susanne Moog 8 months ago

  • Status changed from New to Needs Feedback

Thanks for the report, can you give us a bit more information:

What does the $urlParameters array look like in both cases?

The problem with your example is that &%5Btx_xblog_pi1%5Bplugin%5D%5D=732 would be decoded to &[tx_xblog_pi1[plugin]]=732 which is one nesting level too many. The result should be &tx_blog_pi1%5Bplugin%5D=732 instead (it's fine and expected that the brackets are encoded). I just tested with an example array of ['tx_blog_pi1' => ['plugin' => 732]] with both methods and cannot reproduce your nesting error - it's working fine in my case. Please provide a test case with the input you are using.

#2 Updated by Dirk Wildt 8 months ago

Very, very strange: TYPO3 9.5 behaves with me now as with you. The error is gone and thus fixed :) Sorry for the circumstances.

#3 Updated by Georg Ringer 8 months ago

  • Status changed from Needs Feedback to Closed

I am closing the issue as it seems to be fine now

Also available in: Atom PDF