Review main Merged

73867[BUGFIX] Use defaultScheme setting instead of hard-coded 'http'

Oliver Hader CR +2 V +2 Normal +116 −21 updated 07/07/22, 18:18

Commit message

Several places in the TYPO3 core fall back to using 'http' as
protocol for links in case none was given. In order to adjust this
behavior new $GLOBALS['TYPO3_CONF_VARS']['SYS']['defaultScheme']
setting has been introduced, which uses 'http' as default.

In order to adjust the default protocol, one has to add the following
assignment to their LocalConfiguration.php settings:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['defaultScheme'] = 'https'

Review

  • Code review CR +2 Done
    • Nikita Hovratov +2
    • Oliver Klee +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Nikita Hovratov +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 9

Review log 5875

Show 3950 earlier messages
  1. Oliver Hader uploaded patch set 1 03/10/22, 11:13

  2. Mathias Brodala commented on patch set 1 03/10/22, 11:19

    'defaultScheme' = 'http' would be clearer IMO. This would match the PSR-7 UriInterface which is based on https://datatracker.ietf.org/doc/html/rfc3986#section-4.3
  3. Oliver Hader commented on patch set 1 03/10/22, 11:23

    I'm fine with naming it whatever fits here... I used the term "linkDefaultProtocol" because * the scope is "used in links" `<a href="..">`, not URIs in general * (it's in line with https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-linkDefaultProtocol) Thus, "defaultScheme" also would be fine for me.
  4. core-ci voted on patch set 1 V -1 03/10/22, 11:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/24785

  5. Oli Bartsch commented on patch set 1 03/10/22, 11:25

    UrlLinkHandler.php:60

    Not 100% but I think this should be wrapped in parenthesis to prevent side effects.
  6. Oliver Hader commented on patch set 1 03/10/22, 12:14

    UrlLinkHandler.php:60 Reply

  7. Oliver Hader commented on patch set 2 06/02/22, 06:49

    Published edit on patch set 1.
  8. Oliver Hader commented on patch set 3 06/02/22, 06:50

    Published edit on patch set 2.
  9. core-ci voted on patch set 2 V -1 06/02/22, 06:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27645

  10. core-ci voted on patch set 3 V -1 06/02/22, 06:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27646

  11. Oliver Hader rebased onto patch set 4 06/02/22, 06:53

  12. core-ci voted on patch set 3 V -1 06/02/22, 06:53 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27646

  13. core-ci voted on patch set 4 V -1 06/02/22, 07:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27647

  14. Oliver Hader uploaded patch set 5 06/02/22, 11:13

  15. Oliver Hader uploaded patch set 6 06/02/22, 11:19

  16. Oliver Hader commented on patch set 5 06/02/22, 11:19

    Reply

    Done

    UrlLinkHandler.php:60 Reply

    Done
  17. core-ci voted on patch set 5 V +1 06/02/22, 11:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27654

  18. core-ci voted on patch set 6 V +1 06/02/22, 11:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27655

  19. Oliver Klee commented on patch set 6 06/02/22, 11:59

    DefaultConfiguration.php:378

    We're having the fallback scheme (or the default of the default) as a literal in 3 places now, which creates the risk of the places falling out of sync when changes are made (as it would violate the "single source of truth" principle). Would it make sense to add a class constant to one of the suitable classes and use it instead?
  20. Oliver Hader commented on patch set 6 06/02/22, 12:02

    DefaultConfiguration.php:378 Reply

    Please go ahead and apply your changes/idea to this patch directly. I don't have any clue what you have in your mind. Thanks in advance!
  21. Oliver Klee commented on patch set 6 06/02/22, 12:03

    DefaultConfiguration.php:378 Reply

    Okay, will do. :-)
  22. Oliver Hader commented on patch set 6 06/02/22, 12:06

    DefaultConfiguration.php:378 Reply

    Cool, thx!
  23. Oliver Klee commented on patch set 6 06/03/22, 19:39

    I'll (hopefully) do this on Monday.
  24. Oliver Klee uploaded patch set 7 06/06/22, 09:45

  25. Oliver Klee commented on patch set 7 06/06/22, 09:46

    Done. I'd like to have a second brain on whether the new constant and the new method are in the right places, or whether we should move them around.
  26. Oliver Klee commented on patch set 7 06/06/22, 09:46

    DefaultConfiguration.php:378 Reply

    Done
  27. core-ci voted on patch set 7 V +1 06/06/22, 09:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27725

  28. Oliver Klee voted on patch set 7 CR +1 06/06/22, 10:28

  29. Joey Bouten commented on patch set 7 V +1 CR +1 06/08/22, 11:39

    Verified working, agree with location of constant.

    Reply

    I agree with the location, i can't think of any other location which would be logical in my opinion. Verified path myself.
  30. Oliver Klee commented on patch set 7 06/08/22, 11:44

    Reply

    Done
  31. Oliver Klee commented on patch set 8 06/08/22, 11:49

    Published edit on patch set 7.
  32. Oliver Klee commented on patch set 8 CR +1 06/08/22, 11:49

    Fixed a comment.
  33. Oliver Klee updated the commit message in patch set 9 06/08/22, 11:51

  34. Oliver Klee voted on patch set 9 CR +1 06/08/22, 11:51

  35. Joey Bouten voted on patch set 9 V +1 CR +1 06/08/22, 11:57

  36. core-ci voted on patch set 8 V +1 06/08/22, 11:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27809

  37. core-ci voted on patch set 9 V -1 06/08/22, 12:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27810

  38. Oliver Klee commented on patch set 9 06/08/22, 12:06

    Sigh … a flaky acceptance test again.
  39. core-ci voted on patch set 9 V +1 06/08/22, 12:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27810

  40. Daniel Haupt commented on patch set 9 V +1 CR +1 06/16/22, 09:21

    The patch is working fine. Two thoughts still came to my mind, perhaps due to lack of experience: 1. Why don't we set the default value directly to "https"? 2. Why is this patch not treated as a feature?
  41. Oliver Klee commented on patch set 9 06/16/22, 09:27

    Reply

    > Why don't we set the default value directly to "https"? That would be a change of behavior. (Before this change, the non-configurable fallback was "http:".)
  42. Daniel Haupt commented on patch set 9 06/16/22, 09:30

    Reply

    Ack
  43. Stefan Bürk voted on patch set 9 V +1 CR +1 06/16/22, 20:45

  44. Andreas Kienast commented on patch set 9 06/17/22, 08:50

    Sorry for stepping in that late. Given the naming, I'd expect to configure this option to "http" or "https" only, without the need for "://". This is no hard-blocker for me, thus I won't give a -1 here.
  45. Simon Schaufelberger commented on patch set 9 06/24/22, 01:27

    UrlLinkHandlerTest.php:177

    This is inconsistent with the actual default value. Here it is without "://" but the actual scheme must be with "://"? I also propose to just use http or https without "://" and add that suffix after the method call. That would also be consistent with the UriBuilder
  46. Oliver Klee commented on patch set 9 CR -1 06/24/22, 09:48

    Okay, I see the point. I'll take care of this in the next few days (unless someone does this first).
  47. Simon Schaufelberger commented on patch set 9 06/28/22, 12:23

    on it

    UrlLinkHandlerTest.php:177 Reply

    Done
  48. Simon Schaufelberger uploaded patch set 10 06/28/22, 12:31

  49. Simon Schaufelberger commented on patch set 10 V +1 CR +1 06/28/22, 12:32

    Reply

    Done
  50. Simon Schaufelberger uploaded patch set 11 06/28/22, 12:34

  1. Simon Schaufelberger voted on patch set 11 V +1 CR +1 06/28/22, 12:35

  2. core-ci voted on patch set 11 V -1 06/28/22, 12:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28456

  3. Simon Schaufelberger uploaded patch set 12 06/28/22, 12:45

  4. core-ci voted on patch set 10 V -1 06/28/22, 12:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28455

  5. Simon Schaufelberger voted on patch set 12 V +1 CR +1 06/28/22, 12:47

  6. core-ci voted on patch set 12 V +1 06/28/22, 12:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28457

  7. Oliver Klee voted on patch set 12 CR +1 06/28/22, 12:56

  8. Oliver Klee commented on patch set 12 06/28/22, 12:57

    Thanks for stepping in to do the last changes, Simon!
  9. Andreas Kienast voted on patch set 12 CR +1 07/04/22, 19:39

  10. Torben Hansen voted on patch set 12 V +1 CR +1 07/07/22, 06:11

  11. Stefan Bürk commented on patch set 12 07/07/22, 16:02

    This introduces a new configuration option - which however is a FEATURE. Flagging this as BUGFIX to have it backportable would miss a proper documentation for it. Not sure however. Should we at least add a Importent ReST file for it ? in 12.0 / 11.5.x folder ?
  12. Stefan Bürk commented on patch set 12 07/07/22, 16:02

    Reply

    Failde to remove the resolved mark ;) so re-opening this comment ...
  13. Oli Bartsch commented on patch set 12 07/07/22, 17:15

    Reply

    Yes, I also think this patch should provide at least an Important RST to have this new option documented. This also allows the documentation team to catch up.
  14. Nikita Hovratov commented on patch set 12 07/07/22, 17:27

    Reply

    I will take care, if no one does already.
  15. Nikita Hovratov uploaded patch set 13 07/07/22, 17:48

  16. Nikita Hovratov commented on patch set 13 V +1 CR +1 07/07/22, 17:51

    Reply

    Done
  17. core-ci voted on patch set 13 V -1 07/07/22, 17:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28724

  18. Stefan Bürk uploaded patch set 14 07/07/22, 18:02

  19. Oliver Klee voted on patch set 13 CR +1 07/07/22, 18:02

  20. Oliver Klee voted on patch set 14 CR +1 07/07/22, 18:03

  21. core-ci voted on patch set 13 V +1 07/07/22, 18:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28724

  22. Stefan Bürk voted on patch set 14 V +1 CR +1 07/07/22, 18:05

  23. core-ci voted on patch set 14 V +1 07/07/22, 18:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28725

  24. Nikita Hovratov commented on patch set 14 V +2 CR +2 07/07/22, 18:12

    Thanks Stefan!
  25. Nikita Hovratov merged patch set 15 07/07/22, 18:18