Review main Merged Breaking

61295[!!!][TASK] Remove POST option from typolink.addQueryString.method

Oliver Hader CR +2 V +2 Hard +184 −203 updated 07/21/19, 08:14

Commit message

Setting `addQueryString.method` of typolink could be used like shown
below in order to transform HTTP POST parameters into according GET
parameters.

    typolink {
        parameter = 123
        addQueryString = 1
        addQueryString.method = POST
    }

In terms of correctly using HTTP verbs it's bad practise in general
to treat GET and POST equally, besides that documentation already
mentioned potential side-effects like accidentally exposing sensitive
data submitted via POST to proxies or log files.

That's why values POST, GET,POST and POST,GET are not allowed anymore
for `typolink.addQueryString.method`. Maintaining functionality - if
required at all - has to be done using domain specific logic in
according controllers or middleware implementations.

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Benjamin Franzke +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Benjamin Franzke +1
    • TYPO3com +1 CI

Issues 1

Files 9

Review log 3243

Show 1418 earlier messages
  1. Oliver Hader uploaded patch set 1 07/15/19, 09:17

  2. TYPO3com voted on patch set 1 V -1 07/15/19, 09:30 Completed build in 13m 16s on Mon, 15 Jul, 11:30 AM Test Summary: 44 of 47361 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35034

  3. Oliver Hader uploaded patch set 2 07/16/19, 11:50

  4. Alexander Schnitzler commented on patch set 2 CR -1 07/16/19, 11:55

    UriBuilder.php:628

    I'd replace the switch statement in this case as it acts like if..else.

    ContentObjectRenderer.php:5452

    Same like in UriBuilder. This can be replaced with if..else.
  5. TYPO3com voted on patch set 2 V +1 07/16/19, 12:01 Completed build in 10m 44s on Tue, 16 Jul, 02:01 PM Test Summary: 47006 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35088

  6. Oliver Hader commented on patch set 2 07/16/19, 12:12

    > Patch Set 2: Code-Review-1 > > (2 comments) Fine

    UriBuilder.php:628 Reply

    Ack

    ContentObjectRenderer.php:5452 Reply

    Ack
  7. Oliver Hader marked it work in progress 07/16/19, 12:12

  8. Oliver Hader uploaded patch set 3 07/16/19, 13:13

  9. Oliver Hader commented on patch set 3 07/16/19, 13:13

    This change is ready for review.
  10. TYPO3com voted on patch set 3 V +1 07/16/19, 13:25 Completed build in 11m 54s on Tue, 16 Jul, 03:25 PM Test Summary: 47006 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35092

  11. Oliver Klee commented on patch set 3 07/16/19, 13:31

    UriBuilder.php:326 Unresolved

    More explicit: elseif (unless there is a "return" statement missing)

    TypolinkViewHelperTest.php:69 Unresolved

    Right -> Correct
  12. Alexander Schnitzler commented on patch set 3 CR -1 07/16/19, 13:34

    UriBuilder.php:632

    Sorry for the nitpick but we don't need an empty check here. Even in this state (without https://review.typo3.org/c/Packages/TYPO3.CMS/+/59625), we only need to type safe check if addQueryStringMethod is 'GET' because any other value falls back to the else part, just like the default in the switch statement before.
  13. Alexander Schnitzler commented on patch set 3 07/16/19, 13:38

    UriBuilder.php:632 Reply

    Also, you change the default here with the empty check. Before: Everything but 'GET' resulted in 'QUERY_STRING' Now: Everything but 'GET', null and an empty string result in 'QUERY_STRING'.
  14. Oliver Hader commented on patch set 3 07/16/19, 13:49

    UriBuilder.php:632 Reply

    Actually not, it was: * !$this->addQueryStringMethod -> GeneralUtility::_GET() * $this->addQueryStringMethod === 'GET' -> GeneralUtility::_GET() * $this->addQueryStringMethod -> parse_str(GeneralUtility::getIndpEnv('QUERY_STRING'), $arguments); Using your suggestion would always use 'QUERY_STRING'. However, parsing query string should(?!?) be the same as $_GET. I could only think of magic quotes which was removed in some 5.x release that would have made a difference here.
  15. Alexander Schnitzler commented on patch set 3 CR 0 07/16/19, 14:04

    UriBuilder.php:632 Reply Unresolved

    Yep, sorry, I didn't see the surrounding if statement that acts as a guard clause for the possible null value.
  16. Oliver Hader uploaded patch set 4 07/16/19, 14:07

  17. TYPO3com voted on patch set 4 V +1 07/16/19, 14:19 Completed build in 11m 38s on Tue, 16 Jul, 04:19 PM Test Summary: 47126 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35098

  18. Alexander Schnitzler commented on patch set 4 CR -1 07/17/19, 10:52

    Short information that this patch needs to be rebased and UriBuilder needs to be adjusted.
  1. Alexander Schnitzler rebased onto patch set 5 07/17/19, 12:37

  2. Alexander Schnitzler uploaded patch set 6 07/17/19, 12:47

  3. TYPO3com voted on patch set 5 V +1 07/17/19, 12:48 Completed build in 10m 25s on Wed, 17 Jul, 02:48 PM Test Summary: 47126 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35125

  4. TYPO3com voted on patch set 6 V -1 07/17/19, 12:59 Completed build in 12m 06s on Wed, 17 Jul, 02:59 PM Test Summary: 4 of 47489 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35126

  5. Alexander Schnitzler uploaded patch set 7 07/17/19, 13:12

  6. Alexander Schnitzler commented on patch set 7 07/17/19, 13:15

    UriBuilder.php:654

    Sorry for the hickup here but according to the comment I introduced in the setter, this is wrong. We now have the case that both the default empty string value and the value GET lead to the usage of GeneralUtility::_GET() while all other string values lead to the usage of parse_str(GeneralUtility::getIndpEnv('QUERY_STRING'), $arguments);. This reflects the former behaviour but it's only now that I see how strange this is. Should we adjust the handling once more, set the default value to GET, check for GET or QUERY_STRING, allow only those values in the setter and have a meaningful default value? The current state is very confusing.
  7. TYPO3com voted on patch set 7 V +1 07/17/19, 13:22 Completed build in 10m 13s on Wed, 17 Jul, 03:22 PM Test Summary: 47126 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35128

  8. Andreas Kienast commented on patch set 7 07/17/19, 13:50

    Breaking-88755-RemovePOSTOptionFromTypolinkaddQueryStringmethod.rst:15

    code-block

    Breaking-88755-RemovePOSTOptionFromTypolinkaddQueryStringmethod.rst:52

    html, "fluid" is unknown
  9. Oliver Hader commented on patch set 7 CR -1 07/17/19, 14:25

    UriBuilder.php:654 Reply

    Now it actually should be again either `empty($this->addQueryStringMethod)` or `!$this->addQueryStringMethod` - values could be `''` or `'0'`. Besides that, comment for setAddQueryStringMethod() seems to be wrong, since `GeneralUtility::_GET()` was used as default if property is not set. `setAddQueryStringMethod('anything-else')` would have lead to `QUERY_STRING` (now and in the past)
  10. Oliver Hader uploaded patch set 8 07/17/19, 14:48

  11. Oliver Hader uploaded patch set 9 07/17/19, 14:51

  12. Oliver Hader commented on patch set 9 07/17/19, 14:51

    Breaking-88755-RemovePOSTOptionFromTypolinkaddQueryStringmethod.rst:15 Reply

    Done

    Breaking-88755-RemovePOSTOptionFromTypolinkaddQueryStringmethod.rst:52 Reply

    Done

    UriBuilder.php:654 Reply

    Done
  13. TYPO3com voted on patch set 8 V +1 07/17/19, 15:02 Completed build in 13m 08s on Wed, 17 Jul, 05:01 PM Test Summary: 47126 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35129

  14. TYPO3com voted on patch set 9 V +1 07/17/19, 15:05 Completed build in 14m 07s on Wed, 17 Jul, 05:05 PM Test Summary: 47126 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35130

  15. Alexander Schnitzler commented on patch set 9 07/17/19, 15:43

    UriBuilder.php:328 Unresolved

    We should remove this comment again.

    UriBuilderTest.php:213 Unresolved

    This could be removed as we don't test POST any more.

    UriBuilderTest.php:310 Unresolved

    Here again. Why keep the POST var definition?

    UriBuilderTest.php:421 Unresolved

    Dito

    ContentObjectRendererTest.php:565 Unresolved

    dito
  16. Andreas Kienast uploaded patch set 10 07/19/19, 14:08

  17. TYPO3com voted on patch set 10 V +1 07/19/19, 14:20 Completed build in 11m 46s on Fri, 19 Jul, 04:20 PM Test Summary: 47198 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35221

  18. Frank Nägler voted on patch set 10 CR +1 07/19/19, 14:53

  19. Benni Mack voted on patch set 10 V +1 CR +1 07/19/19, 20:54

  20. Benjamin Franzke voted on patch set 10 CR +1 07/19/19, 21:31

  21. Benjamin Franzke commented on patch set 10 V +1 CR -1 07/20/19, 06:17

    2 minor things: typo3/sysext/fluid/Tests/Functional/ViewHelpers/TypolinkViewHelperTest.php still contains a test 'uri: with add query string and method POST'. Should we remove that one? I mean, theoretically we would need to adapt the test to properly verify that E_USER_WARNING is triggered. typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php still contains an argument description that specifies GET or POST as possible values: > Method to use when keeping query parameters (GET or POST, only active if $actionUri is not set The question is, should we mention "GET or <any>", "GET or QUERY_STRING" (although introducing as QUERY_STRING as new official method name feels wrong as well. I would suggest drop "GET or POST," entirely from that description. Other view helpers do the same.
  22. Benjamin Franzke uploaded patch set 11 07/20/19, 06:58

  23. TYPO3com voted on patch set 11 V +1 07/20/19, 07:09 Completed build in 10m 33s on Sat, 20 Jul, 09:09 AM Test Summary: 47160 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35239

  24. Andreas Kienast voted on patch set 11 V +2 CR +2 07/21/19, 08:14

  25. Andreas Kienast merged patch set 12 07/21/19, 08:14