23966[BUGFIX] Correct storage selection (common prefixes)
Commit message
Review
-
Code review CR +2
- Stefan Neufeind +2
- Wouter Wolters +1
- Markus Klein +1
-
Verified V +2
- Stefan Neufeind +2
- Wouter Wolters +1
- Markus Klein +1
Issues 1
Files 2
Review log 20
-
Mr. Jenkins commented on patch set 1 09/23/13, 08:44
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/10876/ : SUCCESS -
Markus Klein commented on patch set 1 CR -1 09/23/13, 17:21
Wasn't it aggred upon that the commit message shall describe what is changed (positive => commit message) and not was does not work (negative => bug tracker)?ResourceFactory.php:183Wouldn't be this be much faster? if (substr($localPath, strlen($basePath) !== $basePath) otherwise this needs a preg_quote() -
Markus Klein updated the commit message in patch set 1 09/23/13, 17:25
-
Mr. Jenkins commented on patch set 2 09/23/13, 17:36
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/10884/ : SUCCESS -
Ernesto Baschny commented on patch set 1 09/23/13, 19:26
Reply
it was positive before.. "the matching will not consider this *buggy one* the right one .. .anymore".. Maybe the "anymore" is too far away (after the parenthisis and in the next line) to get noticed. ;)ResourceFactory.php:183ReplyI am so used with preg_match that I use it for everything. Just lazyness. True about the preg_quote part, so your suggestion sounds much better. Thanks! -
Ernesto Baschny uploaded patch set 3 09/23/13, 19:35
-
Wouter Wolters commented on patch set 3 V +1 CR +1 09/23/13, 19:42
Verified with the unit-test -
Markus Klein uploaded patch set 4 09/23/13, 19:44
-
Markus Klein commented on patch set 4 V +1 CR +1 09/23/13, 19:45
New patch version to avoid double strlen calculation. -
Stefan Neufeind voted on patch set 4 CR +1 09/23/13, 19:47
-
Wouter Wolters commented on patch set 4 V +1 CR +1 09/23/13, 19:49
Re-verified with unit-test -
Mr. Jenkins commented on patch set 3 09/23/13, 19:55
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/10886/ : SUCCESS -
Stefan Neufeind voted on patch set 4 V +2 CR +2 09/23/13, 19:55
-
Stefan Neufeind merged patch set 5 09/23/13, 19:55
-
Stefan Neufeind commented on patch set 5 09/23/13, 19:55
Cherry Picked This patchset was cherry picked to change: Id14ffd6620554c086b6e77dca285ade8dee39ab2 -
Stefan Neufeind commented on patch set 5 09/23/13, 19:56
Cherry Picked This patchset was cherry picked to change: Id14ffd6620554c086b6e77dca285ade8dee39ab2 -
Mr. Jenkins commented on patch set 4 09/23/13, 20:25
Build Successful https://ci.typo3.org/job/typo3-v4-core-gerrit/10889/ : SUCCESS -
Steffen Ritter commented on patch set 5 09/24/13, 07:10
PostMerge -1 "continues" are not nice at all and to a reader it is not obvious why things happen like that with this substring and continue magic... Code should be speaking... $basePathLength = strlen($basePath); $matchLength = strlen(PathUtility::getCommonPrefix(array($basePath, $localPath))); if ($basePathLength <= $matchLength && $matchLength > $bestMatchLength) { $bestMatchStorageUid = intval($storageUid); $bestMatchLength = $matchLength; } -
Markus Klein commented on patch set 5 09/24/13, 16:57
In general I do not agree with you that "continues" are not nice... But in this case of course it could have been avoided. On the other hand it is clear to read: "If the length does not match, ignore this storage" -
Ernesto Baschny commented on patch set 5 09/26/13, 14:48
While talking about this patch with Steffen, I noticed another oddity (blame on the author!): before we used the PathUtility::getCommonPrefix method. This method does more "magic" than what is now the current state, because it is OS-independent (cares about Windows "/" vs "\" etc). So I guess we should / could / must rewrite this to make use of this utility method instead of a dump "substr()", and at the same time get rid of the continue to please everyone. :) Take a look at https://review.typo3.org/24071 if you are interested...