Skip to content
  • Stefan Bürk's avatar
    [BUGFIX] Avoid evaluating all regexp redirects if early match found · 77e2740e
    Stefan Bürk authored and Christian Kuhn's avatar Christian Kuhn committed
    ext:redirects middleware collected all possible redirects,
    thus evaluating all regexp redirects to find possible matches.
    These collected possible redirects are looped afterwards and
    checked, if redirect is active, meaning not having any start
    and/or end time constraints or if time constrain is in the active
    timespan, returning the first feasible redirect. However this
    evaluated all regexp redirects, even if flat redirects with query
    arguments, flat redirects without query arguments or a regexp
    redirect is found.
    
    This patch changes this behaviour and checks early for found subset
    of possible redirects to avoid evaluating at least all regexp
    redirects even if an early one would be used anyway.
    
    This is a minor performance improvement in case an early redirect
    can be matched, without any effect if no match could be found.
    
    Further performance improvements may be possible but should be done
    in dedicated follow up patches.
    
    Resolves: #96480
    Releases: main, 11.5
    Change-Id: I84170a701d578a74a1780fd87a33d4f3a9af43e8
    Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72980
    
    
    Tested-by: default avatarcore-ci <typo3@b13.com>
    Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
    Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
    77e2740e