85215[BUGFIX] Ignore TypoScript linkVars configuration for Core arguments
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 2
Files 3
Review log 3342
Show 1317 earlier messages
-
Garvin Hicking uploaded patch set 1 07/10/24, 13:00
-
core-ci voted on patch set 1 V -1 07/10/24, 13:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61315
-
Garvin Hicking uploaded patch set 2
V -107/10/24, 13:14 -
core-ci voted on patch set 2 V +1 07/10/24, 13:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61317
-
Lina Wolf commented on patch set 2 CR +1 07/10/24, 13:23
Code looks good to me, didnt try it out yet -
Stefan Froemken commented on patch set 2 07/10/24, 13:41
He he...Happy coding in good old tsref.xmlLinkVarsCalculator.php:80I would prefer move it to top in this foreach as far as possible. Why calling preg_match on something which may be invalid?LinkVarsCalculatorTest.php:47For empty array I prefer `[]` without linebreak. Same in line 53 -
Garvin Hicking uploaded patch set 3
CR +1V +107/10/24, 14:13Apply code review suggestions -
core-ci voted on patch set 3 V -1 07/10/24, 14:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61322
-
Stefan Froemken commented on patch set 3 CR +1 07/10/24, 14:18
LinkVarsCalculator.php:80ReplyDoneLinkVarsCalculatorTest.php:47ReplyDone -
Stefan Froemken voted on patch set 3 CR 0 07/10/24, 14:19
-
Stefan Froemken commented on patch set 3 07/10/24, 14:25
LinkVarsCalculator.php:68Sorry. I haven't seen that `$linkVar=L(12)` will be changed to `$linkVar=L`. Please move it behind preg_match again. Sorry... -
Garvin Hicking uploaded patch set 4
V -107/10/24, 14:44 -
core-ci voted on patch set 4 V +1 07/10/24, 14:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61326
-
Garvin Hicking commented on patch set 4 07/10/24, 14:52
LinkVarsCalculator.php:68ReplyFunny thing, and this helped to find out more. It's allowed to indicate nested arrays: config.linkVars = L|subkey(int) to allow a URL variable like "L[subkey]=4711". So I think we actually need to test on $rootKey here, otherwise parameters would still allow to be added as arrays. Added one more test case for this. Thank you! -
Stefan Froemken voted on patch set 4 CR +1 07/11/24, 19:31
-
Benni Mack commented on patch set 4 07/11/24, 21:02
LinkVarsCalculator.php:66feel free to make this a instance property ($this->coreArguments) -
Christian Kuhn commented on patch set 4 07/11/24, 22:13
LinkVarsCalculator.php:66Replyno property, but a constant, please. this class should stay a stateless service!
-
Garvin Hicking uploaded patch set 5
CR +1V +107/12/24, 08:13Use constant -
Garvin Hicking commented on patch set 5 07/12/24, 08:15
LinkVarsCalculator.php:66ReplyImplemented it like this: public const coreArgumentsToSkip = ['L', 'id', 'no_cache', 'cHash', 'MP']; (cannot use "array" type hint due to PHP 8.3 requirement) I made it public by intent so maybe other code could use this list somehow? But I can happily make it protected too, if you want. -
core-ci voted on patch set 5 V +1 07/12/24, 08:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61463
-
Benni Mack commented on patch set 5 07/15/24, 09:12
LinkVarsCalculator.php:66Replyprotected. -
Tymoteusz Motylewski commented on patch set 5 07/15/24, 10:25
LinkVarsCalculator.php:66is allowed because restricting might have a benefit? I dont get it. -
Garvin Hicking uploaded patch set 6
V +107/15/24, 12:19 -
Garvin Hicking commented on patch set 6 07/15/24, 12:22
LinkVarsCalculator.php:66ReplydoneLinkVarsCalculator.php:66ReplyAppending "?type=xxx" to a URL to request a specific type is something that you may want to restrict through a LinkVars configuration. So doing something like: config.linkVars = type(garvin|tymo) should be allowed. This is not the case with other URL vars like id, L, no_cache, cHash because those are nowadays so tightly coupled to core internals that you shouldn't tamper with that through TypoScript config, or it will lead to the side-effects that SiteMatchers, LanguageMatchers, Cache-Matchers etc. will fail. Since the "type"-matching is pretty open to extensions, this "core" variable IMO does not need to be tightly controlled like the others. If I misunderstood something here, please let me know. I'm also open to other thoughts about this, I only tried to address the bug report with a possible fix that looks valid to me. -
core-ci voted on patch set 6 V +1 07/15/24, 12:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61581
-
Garvin Hicking commented on patch set 6 07/17/24, 19:07
LinkVarsCalculator.php:66ReplyDone -
Lina Wolf commented on patch set 6 08/02/24, 08:19
LinkVarsCalculator.php:66ReplyI agree with Garvins position here -
Garvin Hicking commented on patch set 6 08/14/24, 23:28
LinkVarsCalculator.php:66ReplyAdding Tymoteusz' Feedback here which didn't get through and he sent me via slack: Your explanation Garvin totally makes sense. It's just that this todo comment is hard to grasp without all this context. What would help eg: „type” -> „type” url parameter Also the phrases „allowed to be set” and „restrict” could be improved as we are not setting the „type” parameter value in typoscript, but rather configuring the restriction or keep it possible to configure allowe values in TS. tldr my comment was only about making the todo comment more understandable -
Garvin Hicking uploaded patch set 7
V +108/14/24, 23:53Rewordings -
Garvin Hicking commented on patch set 7 08/14/24, 23:54
LinkVarsCalculator.php:66ReplyDone -
core-ci voted on patch set 7 V -1 08/15/24, 00:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63429
-
Garvin Hicking uploaded patch set 8
V -108/15/24, 07:05Fix whitespace -
core-ci voted on patch set 8 V +1 08/15/24, 07:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63443
-
Stefan Froemken commented on patch set 8 CR -1 08/15/24, 20:40
LinkVarsCalculator.php:32Please always upper case constants: CORE_ARGUMENTS_TO_SKIP -
Stefan Bürk commented on patch set 8 CR -2 08/16/24, 07:55
Garvin, let's have a call/talk about that next week after your vacation. -
Stefan Bürk commented on patch set 8 08/16/24, 07:56
Reply
+ document the outcome here as comment then. -
Garvin Hicking uploaded patch set 9
CR -1V +108/22/24, 08:43Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
core-ci voted on patch set 9 V +1 08/22/24, 08:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63965
-
Garvin Hicking commented on patch set 9 CR -2 V -1 08/22/24, 09:06
Reply
DoneStefan Bürk and I discussed this patch. The possible impact/side effects could be considerate, and would need a larger set of tests and verifications to not break anything, especially due to the backport goal of 11.5 and 12.4. We will postpone testing this to the v13 stabilization sprint later this year, and ideally talk about this on-location to gather more feedback. To recap, the general problem is this: * Caches are cleared * A URL like https://example.com/index.php?id=1&L=4711 is requested * The "L" parameter should be invalid, and falls back to default language * Links are created on the page, but since "L=4711" is evaluated and accepted, and no pages with that language exist, all links built with TypoScript pointing to any page will have an empty href * This result is now CACHED as the default language page result! Any normal user requesting the resulting page will receive the wrong cache result with wrongly cached links The idea of this patch is to not accept a parameter like "L" to prevent that outside URL arguments are used for linkbuilding. The assumption of this patch is, that if parameters like L, chash etc. are not specifically set (via linkVars) the link generation will already utilize the context of the current page request to build links. This assumption needs thorough verification, what could happen if these linkvars are now missing, and people might NOT use "speaking URLs" still, or they might rely on the behaviour that "core arguments" are passed. We will need to think about all these scenarios. Maybe another solution could be to mark requests with possibly "invalid" URL arguments to not be persisted in the cache. Thus, marking as -2 for now.LinkVarsCalculator.php:32ReplyDone -
Lina Wolf wrote 08/26/24, 04:26
Removed reviewer Lina Wolf. -
Benni Mack updated the commit message in patch set 10
V +110/18/24, 13:47Copied Votes: * Code-Review-2 (copy condition: "changekind:NO_CHANGE OR **is:MIN**") -
Garvin Hicking abandoned the change 03/28/25, 12:28
Abandoned. will try to write a "FAQ".