Review main Merged

27122[BUGFIX] No double slash during folder canonicalization

Alexander Stehlik CR +2 V +2 Easy +6 −1 updated 01/30/14, 10:09

Commit message

The canonicalizeAndCheckFolderIdentifier does now check if the given
folder path is just a simple slash (/) and return it before really
canonicalizing the identifier.

This prevents the method returning a double slash (//) which will result
in an error in the isWithin() checkin the local driver.

Review

  • Code review CR +2
    • Frans Saris +2
  • Verified V +2
    • Frans Saris +2

Issues 1

Files 1

Review log 15

  1. Mr. Jenkins commented on patch set 1 01/29/14, 10:51

  2. Fabien Udriot commented on patch set 1 CR +1 01/29/14, 11:38

    AbstractHierarchicalFilesystemDriver.php:93

    I tend to prefer to have one return per method.
  3. Alexander Stehlik uploaded patch set 2 01/29/14, 11:40

  4. Alexander Stehlik commented on patch set 2 01/29/14, 11:41

    Yes, this looks nicer indeed :)
  5. Mr. Jenkins commented on patch set 2 01/29/14, 11:52

  6. Marcin Sągol voted on patch set 2 CR +1 01/29/14, 12:10

  7. Fabien Udriot voted on patch set 2 CR +1 01/29/14, 12:31

  8. Steffen Ritter commented on patch set 2 V +1 CR +2 01/29/14, 13:17

    Had that, too,
  9. Frans Saris commented on patch set 2 01/29/14, 14:10

    AbstractHierarchicalFilesystemDriver.php:96

    I would go for return rtrim($this->canonicalizeAndCheckFileIdentifier($folderPath), '/') . '/';
  10. Alexander Stehlik commented on patch set 2 01/29/14, 14:30

    AbstractHierarchicalFilesystemDriver.php:96 Reply

    I thought about this too, but as far as I can see the single slash is the only case when canonicalizeAndCheckFileIdentifier() will return a trailing slash. So performance wise the current solution is better because otherwise rtrim() would be used on every single run even if it is not required.
  11. Wouter Wolters voted on patch set 2 CR +1 01/29/14, 18:07

  12. Frans Saris updated the commit message in patch set 2 01/30/14, 09:54

  13. Frans Saris commented on patch set 3 V +2 CR +2 01/30/14, 09:56

    Only changed typo in commit message so votes still count.
  14. Frans Saris merged patch set 4 01/30/14, 09:56

  15. Mr. Jenkins commented on patch set 3 01/30/14, 10:09