Project

General

Profile

Actions

Bug #17713

closed

addQueryString.exclude with an empty query string causes &= url parameter

Added by Marc Bastian Heinrichs about 17 years ago. Updated about 16 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2007-10-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.1
PHP Version:
5.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

and in combination with cHash you get broken links

in function getQueryArguments in class tslib_cObj:
with undefined method QUERY_STRING is exploded, so $q_in is an array with one empty element.
$q_out is an array with one empty element, too.
with
foreach ($q_out as $k => $v) {
$content .= '&'.$k.'='.$v;
}
$content will be &=

I've added a check if $k is not empty to solve it. Perhaps you have an better solution.

printlink TS to reproduce:
typolink.parameter.data = page:uid
typolink.parameter.wrap = |,98
typolink.addQueryString = 1
typolink.addQueryString.exclude = cHash
typolink.useCacheHash = 1
(issue imported from #M6576)


Files

6576.patch (488 Bytes) 6576.patch Administrator Admin, 2007-12-12 00:44
6576_B.patch (661 Bytes) 6576_B.patch Administrator Admin, 2008-05-16 15:08
01_useCacheHash.diff (2.05 KB) 01_useCacheHash.diff Administrator Admin, 2008-10-16 13:10
Actions #1

Updated by Marc Bastian Heinrichs almost 17 years ago

sorry, a little bit tricky description. hope this is better:

  • set up a clean t3 installation
  • use following TS setup in the first page:
    page = PAGE
    page.10 = TEXT
    page.10.value = HELLO WORLD!
    page.10.typolink.parameter.data = page:uid
    page.10.typolink.parameter.wrap = |,98
    page.10.typolink.addQueryString = 1
    page.10.typolink.addQueryString.exclude = cHash
    page.10.typolink.useCacheHash = 1
  • open the FE with clean cache and WITHOUT any url parameter (also no ?id= )
  • you get an link to index.php?id=1&type=98&=&cHash=xyz

in combination with realurl I get a "cHash comparison failed" error

Actions #2

Updated by Marc Bastian Heinrichs almost 17 years ago

here is the patch against 4.1.4

Actions #3

Updated by Jörg Wagner over 16 years ago

The patch works, but is not optimal.
I append a patch (6576_B.patch) that attacks the real reason of this problem:

When building the $q_in array in function getQueryArguments, the servers QUERY_STRING is exploded using a '&' delimiter char.
If the QUERY_STRING is empty, the result of this is (as typical for PHP) an array with one empty string value instead of an empty array. This leads to a key value pair of "" => NULL in $q_in.
The added patch solves that wrong behaviour.

It would be great if this could be transmitted to trunk soon - it really kills website links whenever addQueryString.exclude is used!

Actions #4

Updated by Marc Bastian Heinrichs over 16 years ago

Hi Masi,

could you please fix this also in TYPO3_4-1?!
THX

Maba

Actions #5

Updated by Michael Stucki about 16 years ago

I propose a different solution which does not require the cHash parameter to be excluded explicitely, see attached patch.
It will also fix one more problem that linkVars and additionalParams are mixed when calculating the cHash value.

- michael

Actions #6

Updated by Ingo Renner about 16 years ago

closed, as it is shipped in 4.2.1

Actions

Also available in: Atom PDF