Bug #91547

Unique slug building fallback is broken

Added by filigivuji filigivuji over 1 year ago. Updated about 1 year 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

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

Actions
#1

Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64623

#2

Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64623

#3

Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64623

#4

Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64623

#5

Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64623

#6

Updated by Gerrit Code Review over 1 year ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64623

#7

Updated by Gerrit Code Review over 1 year ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64623

#8

Updated by Stefan P over 1 year ago

Can this please be ported to v9 as well, not just master and 10?

All the big setups with hundreds domains and tenthousands of pages are just migrating now to v9 (because they rely on some stability and lots of communications and money). And v9 is sparkled with bugs in this routing/site area... We can't just "upgrade to v10"...

#9

Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65429

#10

Updated by Anja Leichsenring over 1 year ago

sorry, no backport to v9. Especially for the massive instances only now migrating to v9 we must keep this version as stable as possible. We must not risk this stability by backporting any more changes than absolutely necessary.

#11

Updated by Anonymous over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#12

Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed
#13

Updated by Benni Mack 10 months ago

  • Related to Bug #92563: Identical slugs: Appendix stops at "-100" added

Also available in: Atom PDF