Review main Merged

46113[BUGFIX] Absolute URIs get prefixed with absRefPrefix in typolink

Oliver Hader CR +2 V +2 Normal +151 −1 updated 03/05/16, 19:51

Commit message

An absolute URI (e.g. "/folder/someFile.png") gets prefixed with
absRefPrefix (e.g. "/") which results in "//folder/someFile.png",
which is a schema-less URI notation and thus "folder" is
interpreted as hostname.

Review

  • Code review CR +2
    • Anja Leichsenring +2
    • Jan Helke +1
  • Verified V +2
    • Anja Leichsenring +2
    • Jan Helke +1

Issues 1

Files 2

Review log 25

  1. Oliver Hader uploaded patch set 1 01/20/16, 18:20

  2. Oliver Hader commented on patch set 1 01/20/16, 18:37

  3. Richard Haeser voted on patch set 1 CR +1 01/20/16, 21:04

  4. Mathias Brodala commented on patch set 1 CR -1 01/21/16, 08:08

    I suspect an error with an absRefPrefix like "/sub/", let me check first.

    ContentObjectRendererTest.php:4722

    Please try this with something else too like "/sub/".
  5. Mathias Brodala commented on patch set 1 V -1 01/21/16, 08:18

    Error confirmed, I'll push an update.
  6. Mathias Brodala uploaded patch set 2 01/21/16, 08:23

  7. Richard Haeser voted on patch set 2 CR +1 01/21/16, 08:27

  8. Oliver Hader commented on patch set 2 CR -1 01/21/16, 09:44

    ContentObjectRenderer.php:5917

    Having a absolute(!) URI like "/images/whatever.png" and the TYPO3 installation being in "/sub/" with the accordant absRefPrefix - this would turn "/images/whatever.png" into "/sub/images/whatever.png", which is wrong
  9. Oliver Hader voted on patch set 2 CR -2 01/21/16, 09:44

  10. Oliver Hader uploaded patch set 3 01/21/16, 10:13

  11. Oliver Hader commented on patch set 3 CR 0 01/21/16, 10:14

    Reverted the changes in typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php to my first patch set and adjusted Mathias' test cases
  12. Mathias Brodala commented on patch set 3 01/21/16, 10:31

    You're right. If the URI is already absolute, nothing should happen.
  13. Mathias Brodala voted on patch set 3 CR +1 01/21/16, 10:32

  14. Markus Sommer voted on patch set 3 CR +1 V +1 01/22/16, 09:17

  15. Oliver Klee commented on patch set 3 01/22/16, 12:15

    Shouldn't this also go into 6.2?
  16. Frank Nägler commented on patch set 3 01/22/16, 13:35

    ContentObjectRenderer.php:5915

    I would prefer to use StringUtility::beginsWith
  17. Oliver Hader uploaded patch set 4 01/25/16, 19:16

  18. Oliver Hader commented on patch set 4 01/25/16, 19:17

    Integrated Frank's remark on StringUtilitiy... Travis: https://travis-ci.org/ohader/TYPO3.CMS/builds/104717973
  19. Frank Nägler commented on patch set 4 01/25/16, 21:07

    thx for the update. one question about the tests (see my inline comment)

    ContentObjectRendererTest.php:4632

    did we have support for relative pathes e.g. ../foo/bar.png ? Then this should be tested also. Not sure about the supported pathes.
  20. Oliver Hader uploaded patch set 5 03/05/16, 19:22

  21. Oliver Hader rebased onto patch set 6 03/05/16, 19:22

  22. Oliver Hader commented on patch set 6 03/05/16, 19:24

    @Frank: I'm not sure about the intended behavior for ".." paths... which just are passed along now. Fixing possible issues in that regard should go to a different issue however.
  23. Jan Helke voted on patch set 6 CR +1 V +1 03/05/16, 19:38

  24. Anja Leichsenring voted on patch set 6 CR +2 V +2 03/05/16, 19:51

  25. Gerrit merged patch set 6 03/05/16, 19:51