Review main Abandoned

60236[BUGFIX] Resolve hash when found, otherwise return given value

Devid Messner CR 0 V 0 Easy +4 −14 updated 11/23/19, 10:02

Commit message

Remove throwing an exception that is never caught and never used anyway.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 1

Review log 1824

  1. Devid Messner uploaded patch set 1 03/13/19, 12:26

  2. TYPO3com voted on patch set 1 V -1 03/13/19, 12:39 Completed build in 13m 37s on Wed, 13 Mar, 01:39 PM Test Summary: 38 of 47593 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32694

  3. Oliver Klee updated the commit message in patch set 2 03/13/19, 13:10

  4. TYPO3com voted on patch set 2 V -1 03/13/19, 13:20 Completed build in 10m 18s on Wed, 13 Mar, 02:20 PM Test Summary: 36 of 47593 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32695

  5. Devid Messner uploaded patch set 3 03/13/19, 14:25

  6. Wolfgang Klinger uploaded patch set 4 03/13/19, 14:31

  7. Oliver Klee commented on patch set 4 03/13/19, 14:32

    VariableProcessor.php:63

    This annotation then needs to be removed as well.

    VariableProcessor.php:63

    This annotation then needs to be removed as well.
  8. Wolfgang Klinger commented on patch set 4 V +1 CR +1 03/13/19, 14:34

    I updated the patch, imho it's not necessary to compare with a specific key here. Content-wise it makes no difference without exception (values with a lower length than 32 are returned as-is currently too), so it has been removed.
  9. Wolfgang Klinger uploaded patch set 5 03/13/19, 14:36

  10. Wolfgang Klinger commented on patch set 5 03/13/19, 14:37

    > Patch Set 4: > > (2 comments) Nice catch, done
  11. TYPO3com voted on patch set 3 V +1 03/13/19, 14:40 Completed build in 15m 35s on Wed, 13 Mar, 03:40 PM Test Summary: 47200 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32696

  12. TYPO3com voted on patch set 4 V +1 03/13/19, 14:49 Completed build in 17m 47s on Wed, 13 Mar, 03:49 PM Test Summary: 47200 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32697

  13. TYPO3com voted on patch set 5 V +1 03/13/19, 14:58 Completed build in 19m 49s on Wed, 13 Mar, 03:58 PM Test Summary: 47200 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32700

  14. Oliver Klee updated the commit message in patch set 6 03/13/19, 15:13

  15. TYPO3com voted on patch set 6 V +1 03/13/19, 15:27 Completed build in 14m 47s on Wed, 13 Mar, 04:27 PM Test Summary: 47200 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-32701

  16. Björn Steinbrink commented on patch set 6 03/20/19, 13:41

    This doesn't seem to solve the problem, it just turns the exception into a silent logic error. When generating a URL, parameters with long names that aren't captured in the route are still turned into hashes. Before this patch, that resulted in the exception that is being removed. With this patch this just leads to the parameter being passed in with its hashed name, not with the original name. I also wonder why that URL with the hashed parameter is accepted at all, shouldn't that lead to a cHash validation error?
  17. Michael Telgkamp commented on patch set 6 V +1 CR +1 11/18/19, 16:26

    Patchset 6 solves my problem and I do not get any additional problems. But I do not know the reason why the exception was initially added, might be for security reasons.
  18. Alexander Schnitzler commented on patch set 6 11/20/19, 14:00

    VariableProcessor.php:64

    Why changing the variable name? $hash is a perfect fit imho.
  19. Michael Telgkamp commented on patch set 6 CR 0 11/20/19, 16:00

    VariableProcessor.php:64 Reply

    It could be a hash, but is not always a hash. It also could be a non hashed parameter name. I must admit $value might also be confusing.
  20. Alexander Schnitzler commented on patch set 6 11/20/19, 18:53

    VariableProcessor.php:64 Reply

    Maybe I don't get the idea of this method and that's the problem. I trust you here. ^^
  21. Oliver Hader commented on patch set 6 CR -1 11/21/19, 09:34

    This is a "works on my machine" bugfix... In order to make sure it works for everybody, we should have additional tests that reproduce exactly the problem that Michael described on Forge.

    VariableProcessor.php:64 Reply

    > Maybe I don't get the idea of this method and that's the problem. I trust you here. ^^ A "hash" in this class is used to substitute variable names with a corresponding hash value when generating or resolving route parameters. The reason for having it at all is that Symfony Routes have a limitation on the length of variable names...
  22. Oliver Hader commented on patch set 6 CR -2 11/22/19, 15:16

    → it tried to reproduce the reported behavior with [31,32,32]-character URI parameters and namespace-argument combinations but did not success to reproduce it My guess is, that some custom RouteEnhancer is used that does not consequently apply parameters concerning deflating and inflating (which is used to normalize those values for Symfony routing and their regular expression handling)
  23. Oliver Hader commented on patch set 6 11/23/19, 09:54

    > Patch Set 6: > > This doesn't seem to solve the problem, it just turns the exception into a silent logic error. When generating a URL, parameters with long names that aren't captured in the route are still turned into hashes. Before this patch, that resulted in the exception that is being removed. With this patch this just leads to the parameter being passed in with its hashed name, not with the original name. > > I also wonder why that URL with the hashed parameter is accepted at all, shouldn't that lead to a cHash validation error? Absolutely correct, that patch did not solve the issue but would have hidden it further behind a convenient hack. cHash validation happens at a later point (not in PageRouter, yet) - that's why that did not kick in - besides that cHash exceptions/whitelists could have been applied as well...
  24. Oliver Hader abandoned the change 11/23/19, 10:02