Project

General

Profile

Actions

Bug #91547

closed

Unique slug building fallback is broken

Added by filigivuji filigivuji almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & 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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #92563: Identical slugs: Appendix stops at "-100"Closed2020-10-14

Actions
Actions

Also available in: Atom PDF