Actions
Bug #91547
closedUnique slug building fallback is broken
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
-
Start date:
2020-05-31
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
SlugHelper.php contains three occasions of a loop like this:
$counter = 0;
while (!$this->isUniqueInSite( /* ... */
) && $counter++ < 100
) {
/* ... */
}
if ($counter === 100) {
/* ... */
}
This loop is broken because the comparison uses post-increment, and in case no valid slug with a counter suffix is found, $counter
will be 101, not 100.
Note that I didn't bother to try to reproduce this. Unless I'm overlooking something, I suppose this case has never been tested to begin with.
Affects master, 10.4 and 9.5.
Actions