GitHub/WoltLab/WCF.git
2 years agoMerge pull request #4853 from WoltLab/wcfsetup-asset-cleanup
Tim Düsterhus [Wed, 8 Jun 2022 09:08:32 +0000 (11:08 +0200)]
Merge pull request #4853 from WoltLab/wcfsetup-asset-cleanup

Clean up asset handling in WCFSetup

2 years agoUse explicit null favicon in WCFSetup to prevent /favicon.ico requests
Tim Düsterhus [Wed, 8 Jun 2022 08:42:33 +0000 (10:42 +0200)]
Use explicit null favicon in WCFSetup to prevent /favicon.ico requests

Technique taken from here: https://stackoverflow.com/a/38917888/782822

2 years agoRemove Font Awesome from WCFSetup
Tim Düsterhus [Wed, 8 Jun 2022 08:39:28 +0000 (10:39 +0200)]
Remove Font Awesome from WCFSetup

WCFSetup does not use any icons, thus there is no need to load them.

2 years agoMerge branch '5.5'
Tim Düsterhus [Wed, 8 Jun 2022 07:31:52 +0000 (09:31 +0200)]
Merge branch '5.5'

2 years agoMerge branch '5.4' into 5.5
Tim Düsterhus [Wed, 8 Jun 2022 07:31:42 +0000 (09:31 +0200)]
Merge branch '5.4' into 5.5

2 years agoRelease 5.4.19 5.4.19
Alexander Ebert [Tue, 7 Jun 2022 15:02:19 +0000 (17:02 +0200)]
Release 5.4.19

2 years agoAdd `#[\SensitiveParameter]` attribute to a large number of parameters
Tim Düsterhus [Tue, 7 Jun 2022 14:46:28 +0000 (16:46 +0200)]
Add `#[\SensitiveParameter]` attribute to a large number of parameters

see #4802

2 years agoMerge pull request #4851 from WoltLab/request-cleanup
Tim Düsterhus [Tue, 7 Jun 2022 14:15:38 +0000 (16:15 +0200)]
Merge pull request #4851 from WoltLab/request-cleanup

Clean up wcf\system\request\Request

2 years agoDo not modify state in RequestHandler::buildRequest()
Tim Düsterhus [Fri, 3 Jun 2022 10:38:01 +0000 (12:38 +0200)]
Do not modify state in RequestHandler::buildRequest()

2 years agoImprove typing in \wcf\system\request\Request
Tim Düsterhus [Fri, 3 Jun 2022 10:32:03 +0000 (12:32 +0200)]
Improve typing in \wcf\system\request\Request

2 years agoMake \wcf\system\request\Request externally immutable
Tim Düsterhus [Fri, 3 Jun 2022 10:30:11 +0000 (12:30 +0200)]
Make \wcf\system\request\Request externally immutable

2 years agoRemove deprecated Request::isExecuted()
Tim Düsterhus [Fri, 3 Jun 2022 10:28:18 +0000 (12:28 +0200)]
Remove deprecated Request::isExecuted()

2 years agoMerge branch '5.5'
Tim Düsterhus [Tue, 7 Jun 2022 14:07:00 +0000 (16:07 +0200)]
Merge branch '5.5'

2 years agoFix update instructions from 5.4 5.5.0_RC_1
Tim Düsterhus [Tue, 7 Jun 2022 12:27:47 +0000 (14:27 +0200)]
Fix update instructions from 5.4

2 years agoRelease 5.5.0 RC 1
Alexander Ebert [Tue, 7 Jun 2022 11:17:32 +0000 (13:17 +0200)]
Release 5.5.0 RC 1

2 years agoUpdating minified JavaScript files
WoltLab [Tue, 7 Jun 2022 11:06:42 +0000 (11:06 +0000)]
Updating minified JavaScript files

2 years agoAdd symfony/polyfill-php82 composer dependency
Tim Düsterhus [Tue, 7 Jun 2022 11:03:04 +0000 (13:03 +0200)]
Add symfony/polyfill-php82 composer dependency

see #4802

2 years agoUpdate composer dependencies
Tim Düsterhus [Tue, 7 Jun 2022 11:01:43 +0000 (13:01 +0200)]
Update composer dependencies

2 years agoMerge branch '5.5'
Tim Düsterhus [Tue, 7 Jun 2022 10:01:40 +0000 (12:01 +0200)]
Merge branch '5.5'

2 years agoClear `AVAILABLE_UPGRADE_VERSION` for 5.5
Tim Düsterhus [Tue, 7 Jun 2022 10:01:01 +0000 (12:01 +0200)]
Clear `AVAILABLE_UPGRADE_VERSION` for 5.5

see 15933d22a95b67d57ae794a88471098326911aba

2 years agoMerge branch '5.4' into 5.5
Tim Düsterhus [Tue, 7 Jun 2022 10:00:14 +0000 (12:00 +0200)]
Merge branch '5.4' into 5.5

2 years agoInconsistent behavior of text formatting on iPadOS
Alexander Ebert [Mon, 6 Jun 2022 12:17:51 +0000 (14:17 +0200)]
Inconsistent behavior of text formatting on iPadOS

See https://www.woltlab.com/community/thread/295811-schriftfarbe-schriftart-oder-schriftgr%C3%B6%C3%9Fe-%C3%A4ndern-auf-ipad/

2 years agoMissing comma
Alexander Ebert [Sun, 5 Jun 2022 10:25:28 +0000 (12:25 +0200)]
Missing comma

2 years agoBroken auth dialog for package update servers
Alexander Ebert [Fri, 3 Jun 2022 16:37:44 +0000 (18:37 +0200)]
Broken auth dialog for package update servers

See https://www.woltlab.com/community/thread/295831-fehler-beim-update-beta-3-4/

2 years agoAborting a previously successful worker failed
Alexander Ebert [Fri, 3 Jun 2022 15:01:14 +0000 (17:01 +0200)]
Aborting a previously successful worker failed

See https://www.woltlab.com/community/thread/295857-schlie%C3%9Fen-des-dialogs-beim-anzeigen-aktualisieren-unterbricht-das-aktualisieren/

2 years agoMerge pull request #4852 from WoltLab/upgrade-to-55
Alexander Ebert [Fri, 3 Jun 2022 14:49:07 +0000 (16:49 +0200)]
Merge pull request #4852 from WoltLab/upgrade-to-55

Enable the upgrade to WoltLab Suite 5.5

2 years agoIncorrect URL for the upgrade instructions
Alexander Ebert [Fri, 3 Jun 2022 13:36:39 +0000 (15:36 +0200)]
Incorrect URL for the upgrade instructions

2 years agoEnable the upgrade to WoltLab Suite 5.5
Alexander Ebert [Fri, 3 Jun 2022 13:10:21 +0000 (15:10 +0200)]
Enable the upgrade to WoltLab Suite 5.5

Based on 41f100782ce6abe92f144810b719c15e53bf4849

2 years agoDrop WebP check from PackageEnableUpgradeOverrideForm
Tim Düsterhus [Fri, 3 Jun 2022 12:24:27 +0000 (14:24 +0200)]
Drop WebP check from PackageEnableUpgradeOverrideForm

2 years agoMerge branch '5.5'
Tim Düsterhus [Fri, 3 Jun 2022 12:23:54 +0000 (14:23 +0200)]
Merge branch '5.5'

2 years agoSync update_com.woltlab.wcf_5.5_ensureInnoDbSearch.php with PackageEnableUpgradeOverr...
Tim Düsterhus [Fri, 3 Jun 2022 12:22:36 +0000 (14:22 +0200)]
Sync update_com.woltlab.wcf_5.5_ensureInnoDbSearch.php with PackageEnableUpgradeOverrideForm

see 94607cf2b21854a52f2805ad4211b74d6d9cbe96

2 years agoMerge branch '5.4' into 5.5
Tim Düsterhus [Fri, 3 Jun 2022 12:22:16 +0000 (14:22 +0200)]
Merge branch '5.4' into 5.5

2 years agoMerge pull request #4849 from WoltLab/package-override-55
Tim Düsterhus [Fri, 3 Jun 2022 12:21:57 +0000 (14:21 +0200)]
Merge pull request #4849 from WoltLab/package-override-55

Update checks in PackageEnableUpgradeOverrideForm for 5.5

2 years agoImprove issue description in PackageEnableUpgradeOverrideForm
Tim Düsterhus [Fri, 3 Jun 2022 12:18:56 +0000 (14:18 +0200)]
Improve issue description in PackageEnableUpgradeOverrideForm

2 years agoFix PackageEnableUpgradeOverrideForm
Tim Düsterhus [Fri, 3 Jun 2022 12:14:54 +0000 (14:14 +0200)]
Fix PackageEnableUpgradeOverrideForm

The form differs from the update scripts by also having a title for each issue.

2 years agoMerge branch '5.5'
Tim Düsterhus [Fri, 3 Jun 2022 10:09:35 +0000 (12:09 +0200)]
Merge branch '5.5'

2 years agoMerge branch '5.4' into 5.5
Tim Düsterhus [Fri, 3 Jun 2022 10:08:33 +0000 (12:08 +0200)]
Merge branch '5.4' into 5.5

2 years agoDrop files_pre_check.tar from 5.4 -> 5.5 upgrade
Tim Düsterhus [Fri, 3 Jun 2022 09:51:46 +0000 (11:51 +0200)]
Drop files_pre_check.tar from 5.4 -> 5.5 upgrade

2 years agoUpdate checks in PackageEnableUpgradeOverrideForm for 5.5
Tim Düsterhus [Fri, 3 Jun 2022 08:08:54 +0000 (10:08 +0200)]
Update checks in PackageEnableUpgradeOverrideForm for 5.5

- update_com.woltlab.wcf_5.5_ensureInnoDbSearch.php

2 years agoDrop duplicate empty line in RequestHandler
Tim Düsterhus [Fri, 3 Jun 2022 08:13:41 +0000 (10:13 +0200)]
Drop duplicate empty line in RequestHandler

2 years agoRe-add search addon to CodeMirror
Tim Düsterhus [Fri, 3 Jun 2022 07:52:15 +0000 (09:52 +0200)]
Re-add search addon to CodeMirror

The browser search does not work well with CodeMirror, re-add the search addon
to make Ctrl+F work more or less as expected.

This got lost when CodeMirror was adjusted to make use of require.js in
480b6b11d0822015d4fe4515e7a72b495fe78a69.

2 years agoIncorrect tracking of open page overlays
Alexander Ebert [Thu, 2 Jun 2022 16:54:19 +0000 (18:54 +0200)]
Incorrect tracking of open page overlays

Calling this method (implicitly) while the dialog is still open causes the same dialog to be counted multiple times.

See https://www.woltlab.com/community/thread/295827-boxen-im-benutzerprofil/

2 years agoIncorrect editor access from within a dialog
Alexander Ebert [Thu, 2 Jun 2022 16:26:11 +0000 (18:26 +0200)]
Incorrect editor access from within a dialog

See https://www.woltlab.com/community/thread/295821-fehler-beim-einf%C3%BCgen-von-zitaten/

2 years agoMerge branch '5.4' into 5.5
Tim Düsterhus [Thu, 2 Jun 2022 14:12:14 +0000 (16:12 +0200)]
Merge branch '5.4' into 5.5

2 years agoFix update instructions from 5.4
Tim Düsterhus [Thu, 2 Jun 2022 14:11:52 +0000 (16:11 +0200)]
Fix update instructions from 5.4

2 years agoPreset was lacking the inversion of permissions
Alexander Ebert [Thu, 2 Jun 2022 14:11:32 +0000 (16:11 +0200)]
Preset was lacking the inversion of permissions

See https://www.woltlab.com/community/thread/295793-box-kopieren-option-wird-nicht-%C3%BCbernommen/

2 years agoRevert "Removed the upgrade instructions from 5.4.*"
Tim Düsterhus [Thu, 2 Jun 2022 14:10:37 +0000 (16:10 +0200)]
Revert "Removed the upgrade instructions from 5.4.*"

This reverts commit a3f3064f44253cc761748f38742aae6027e4c2dd.

2 years agoForce a refresh of CodeMirror on tab navigation
Alexander Ebert [Thu, 2 Jun 2022 14:02:02 +0000 (16:02 +0200)]
Force a refresh of CodeMirror on tab navigation

See https://www.woltlab.com/community/thread/295824-codemirror-gerne-mal-nicht-initialisiert/

2 years agoBad position of the mobile overflow indicator
Alexander Ebert [Thu, 2 Jun 2022 13:02:37 +0000 (15:02 +0200)]
Bad position of the mobile overflow indicator

See https://www.woltlab.com/community/thread/295832-men%C3%BCschatten-mobil/

2 years agoImproved phrasing on the behavior of polling
Alexander Ebert [Thu, 2 Jun 2022 12:37:41 +0000 (14:37 +0200)]
Improved phrasing on the behavior of polling

See https://www.woltlab.com/community/thread/295788-fehlerhafte-sprachvariable-wcf-acp-option-enable-polling-description/

2 years agoMerge pull request #4846 from WoltLab/i18n-landing-page
Tim Düsterhus [Thu, 2 Jun 2022 11:33:03 +0000 (13:33 +0200)]
Merge pull request #4846 from WoltLab/i18n-landing-page

Fix handling of i18n landing pages

2 years agoRemove the soft redirect for landing page i18n CMS pages
Tim Düsterhus [Thu, 2 Jun 2022 09:40:40 +0000 (11:40 +0200)]
Remove the soft redirect for landing page i18n CMS pages

This is no longer required since the previous commit which ensured that i18n
CMS landing pages will *always* perform the redirect.

This likely should be improved in a follow up commit to perform the redirect in
RequestHandler / ControllerMap::lookupDefaultController(), instead of relying
on the URL canonicalization feature, as this allows for a more fine-grained
control over the redirect, e.g. allowing to set a `vary: accept-language`
response header.

2 years agoDo not strip the controller in URLs for i18n landing pages
Tim Düsterhus [Wed, 1 Jun 2022 15:30:54 +0000 (17:30 +0200)]
Do not strip the controller in URLs for i18n landing pages

Previously using an i18n CMS page as the landing page caused very odd behavior
as described in commit 0c03edef97240baa6374ce59e986245fb8ffedec.

Landing pages naturally cannot contain a language specific custom controller as
they don't have a controller within the URL, thus requests to the landing page
URL need to be dispatched to one of the languages in
ControllerMap::lookupDefaultController().

It was decided to dispatch to the user's current language which certainly is
the best solution from the UX perspective.

However this dynamic dispatch is problematic, because for i18n landing pages
the variant with the default language was also proclaimed to be the default
controller in ControllerMap::isDefaultController(), thus stripping it from the
language specific custom controller.

Ultimately this overloaded accesses to the landing page to both mean “the
default language” and “whatever language the user uses” at the same time,
unpredictably returning either a HTTP 200 or a HTTP 307 when canonicalizing the
URL in CmsPage depending on the user's language, ultimately dropping the
landing page from the search index of common search engines when it is crawled
in a non-default language.

Fix this whole mess by not stripping the controller from the URL for i18n
pages, allowing every language, including the default language, to have a
stable URL that will always return a HTTP 200 no matter the user's language.
The landing page will then dynamically redirect to the user's language,
preserving the UX enhancement without any of the drawbacks.

2 years agoRemove dead branch in ControllerMap::lookupDefaultController()
Tim Düsterhus [Thu, 2 Jun 2022 09:24:58 +0000 (11:24 +0200)]
Remove dead branch in ControllerMap::lookupDefaultController()

It was impossible to take this branch since
d10487d5b8f54ce86fa8d8f36649febd338dbae8, because since this commit i18n CMS
pages (which this branch was about) were unable to have an empty custom URL.

Since 1bfaae39040d6b56ed837b5c66aa7931ffaca9b5 it is entirely impossible for
any empty custom URLs to exist, making this branch completely dead.

Further it only ever supported the WCF landing page, not any application's
landing pages.

The original intent of this branch will be restored in a follow up commit.

2 years agoMerge pull request #4847 from WoltLab/ci-controller-lookup
Tim Düsterhus [Thu, 2 Jun 2022 11:24:37 +0000 (13:24 +0200)]
Merge pull request #4847 from WoltLab/ci-controller-lookup

Remove reverse lookup for RoutingCacheBuilder::getCaseInsensitiveControllers()

2 years agoRemove reverse lookup for RoutingCacheBuilder::getCaseInsensitiveControllers()
Tim Düsterhus [Thu, 2 Jun 2022 10:42:36 +0000 (12:42 +0200)]
Remove reverse lookup for RoutingCacheBuilder::getCaseInsensitiveControllers()

This reverse lookup is not used, drop it to simplify the logic.

2 years agoRemove useless temporary in RoutingCacheBuilder::getCustomUrls()
Tim Düsterhus [Thu, 2 Jun 2022 10:09:48 +0000 (12:09 +0200)]
Remove useless temporary in RoutingCacheBuilder::getCustomUrls()

2 years agoSimplify RoutingCacheBuilder::getCustomUrls()
Tim Düsterhus [Thu, 2 Jun 2022 10:08:36 +0000 (12:08 +0200)]
Simplify RoutingCacheBuilder::getCustomUrls()

By creating the arrays for all known abbreviations early we can avoid checking
the existence of them over and over again.

2 years agoSimplify `isset()` check in ControllerMap::lookup()
Tim Düsterhus [Thu, 2 Jun 2022 10:06:24 +0000 (12:06 +0200)]
Simplify `isset()` check in ControllerMap::lookup()

The first test was a prefix of the second, thus it is implicitly checked.

2 years agoSimplify `isset()` check in ControllerMap::resolve()
Tim Düsterhus [Thu, 2 Jun 2022 10:03:52 +0000 (12:03 +0200)]
Simplify `isset()` check in ControllerMap::resolve()

The first test was a prefix of the second, thus it is implicitly checked.

Also run the `wcf` check in all cases, while this might check the same entry
twice for `$application == 'wcf'`, this will not have a relevant performance
impact and make the code much more readable.

2 years agoMerge branch '5.5'
Tim Düsterhus [Thu, 2 Jun 2022 09:13:26 +0000 (11:13 +0200)]
Merge branch '5.5'

2 years agoMerge branch '5.4' into 5.5
Tim Düsterhus [Thu, 2 Jun 2022 08:37:15 +0000 (10:37 +0200)]
Merge branch '5.4' into 5.5

2 years agoCreate the initial user with a non-NULL signature
Tim Düsterhus [Thu, 2 Jun 2022 08:35:38 +0000 (10:35 +0200)]
Create the initial user with a non-NULL signature

see #4845
see 8cf90dac71a2e42c56dafba6e23f0dd5a1c5d64c

2 years agoFix PHP 8.1 compatibility in UserRebuildDataWorker for NULL signatures
Tim Düsterhus [Thu, 2 Jun 2022 08:33:43 +0000 (10:33 +0200)]
Fix PHP 8.1 compatibility in UserRebuildDataWorker for NULL signatures

see #4845

2 years agoRelease 5.4.18 5.4.18
Alexander Ebert [Thu, 2 Jun 2022 08:22:58 +0000 (10:22 +0200)]
Release 5.4.18

2 years agoAdjust PHP versions in environment check for 5.5
Tim Düsterhus [Tue, 31 May 2022 13:42:50 +0000 (15:42 +0200)]
Adjust PHP versions in environment check for 5.5

see 598b72301a2cdcd0f3a0c1196f6fc1107e01650e

(cherry picked from commit c2ae090f6bf0a0eefd5eaf9796095a4ddd18c23a)

2 years agoMerge pull request #4844 from WoltLab/custom-controller
Tim Düsterhus [Wed, 1 Jun 2022 15:30:04 +0000 (17:30 +0200)]
Merge pull request #4844 from WoltLab/custom-controller

Clean up handling of custom controllers

2 years agoRemove now-unused $landingPages parameter from RoutingCacheBuilder::getCustomUrls()
Tim Düsterhus [Wed, 1 Jun 2022 15:04:47 +0000 (17:04 +0200)]
Remove now-unused $landingPages parameter from RoutingCacheBuilder::getCustomUrls()

2 years agoRemove dead branch in ControllerMap::isDefaultController()
Tim Düsterhus [Wed, 1 Jun 2022 15:00:55 +0000 (17:00 +0200)]
Remove dead branch in ControllerMap::isDefaultController()

Since the previous changes it is impossible for an entry `''` to exist in the
custom URL mapping, causing this branch to never be taken.

This essentially reverts e6fac1cae9428760436179efc10cc7989c2d64b9.

2 years agoRevert "Revert "Reject empty `controller` in ControllerMap::resolveCustomController()""
Tim Düsterhus [Wed, 1 Jun 2022 14:58:32 +0000 (16:58 +0200)]
Revert "Revert "Reject empty `controller` in ControllerMap::resolveCustomController()""

This check will now work correctly, since the custom URL for non-i18n pages is
no longer cleared since the previous commit.

This reverts commit bd46b32207b5784c481277f4c2a8c81deff49f9c.

2 years agoRemove logic for the clearing of custom URLs for CMS pages from RoutingCacheBuilder
Tim Düsterhus [Wed, 1 Jun 2022 14:40:56 +0000 (16:40 +0200)]
Remove logic for the clearing of custom URLs for CMS pages from RoutingCacheBuilder

This is workaround is no longer required or useful since the previous commit,
since `ControllerMap::isDefaultController()` will correctly return `true` for
those CMS pages, leading to the route builder dropping the controller part in
the URL.

2 years agoUpdating minified JavaScript files 5.4.17
WoltLab [Wed, 1 Jun 2022 14:46:52 +0000 (14:46 +0000)]
Updating minified JavaScript files

2 years agoRelease 5.4.17
Alexander Ebert [Wed, 1 Jun 2022 14:41:15 +0000 (16:41 +0200)]
Release 5.4.17

2 years agoMerge branch '5.3' into 5.4
Alexander Ebert [Wed, 1 Jun 2022 14:40:30 +0000 (16:40 +0200)]
Merge branch '5.3' into 5.4

2 years agoRelease 5.3.23 5.3.23
Alexander Ebert [Wed, 1 Jun 2022 14:37:56 +0000 (16:37 +0200)]
Release 5.3.23

2 years agoMerge branch '5.2' into 5.3
Alexander Ebert [Wed, 1 Jun 2022 14:37:15 +0000 (16:37 +0200)]
Merge branch '5.2' into 5.3

2 years agoSkip page content without custom URL in RoutingCacheBuilder::getCustomUrls()
Tim Düsterhus [Wed, 1 Jun 2022 14:30:28 +0000 (16:30 +0200)]
Skip page content without custom URL in RoutingCacheBuilder::getCustomUrls()

This select was missing this condition ever since it was added in commit
c2de61fb187cf357cd9653693a8fa7cad39ca6ef. It is not entirely clear, why this
condition is missing, but everything indicates that this is a bug:

The customURL for the page content can only ever be missing for pages backed by
an actual controller (i.e. non-CMS pages).

All those pages having the same empty controller will lead to conflicts in the
resulting mapping table, with some undefined entry "winning" and ending up in
the table. This specifically nullifies the effort of clearing the custom URL
for non-i18n CMS pages that are landing pages. However by chance this all ends
up working as intended, because the look up of the custom URL for those CMS
pages will then result in an empty string for the controller, which is then
completely ignored by the route building, skipping the logic in
ControllerMap::isDefaultController() which relies on the empty controller
pointing to the landing page instead of some random page.

Clean this up by properly ignoring page content without a custom URL.

2 years agoRelease 5.2.21 5.2.21 5.2.final
Alexander Ebert [Wed, 1 Jun 2022 14:34:57 +0000 (16:34 +0200)]
Release 5.2.21

2 years agoReduced width of dropdown menus in mobile view
Marcel Werk [Wed, 1 Jun 2022 14:30:50 +0000 (16:30 +0200)]
Reduced width of dropdown menus in mobile view

2 years agoMerge branch '3.1' into 5.2
Alexander Ebert [Wed, 1 Jun 2022 14:29:04 +0000 (16:29 +0200)]
Merge branch '3.1' into 5.2

2 years agoRelease 3.1.29 3.1.29 3.1.final
Alexander Ebert [Wed, 1 Jun 2022 14:26:21 +0000 (16:26 +0200)]
Release 3.1.29

2 years agoMerge pull request #4842 from WoltLab/landing-page-cleanup
Tim Düsterhus [Wed, 1 Jun 2022 13:40:11 +0000 (15:40 +0200)]
Merge pull request #4842 from WoltLab/landing-page-cleanup

Remove Page::$isLandingPage

2 years agoUpdate composer dependencies
Tim Düsterhus [Wed, 1 Jun 2022 13:32:40 +0000 (15:32 +0200)]
Update composer dependencies

2 years agoMerge branch '5.5'
Tim Düsterhus [Wed, 1 Jun 2022 13:32:11 +0000 (15:32 +0200)]
Merge branch '5.5'

2 years agoUpdate composer dependencies
Tim Düsterhus [Wed, 1 Jun 2022 13:32:00 +0000 (15:32 +0200)]
Update composer dependencies

2 years agoAdd database/update_com.woltlab.wcf_5.6.php
Tim Düsterhus [Wed, 1 Jun 2022 13:09:30 +0000 (15:09 +0200)]
Add database/update_com.woltlab.wcf_5.6.php

2 years agoSimplify RoutingCacheBuilder::getLandingPage()
Tim Düsterhus [Wed, 1 Jun 2022 13:05:08 +0000 (15:05 +0200)]
Simplify RoutingCacheBuilder::getLandingPage()

Reduce the amount of special handling required for the 'wcf' app.

2 years agoRemove the Page::$isLandingPage property
Tim Düsterhus [Wed, 1 Jun 2022 12:20:28 +0000 (14:20 +0200)]
Remove the Page::$isLandingPage property

This property is redundant with wcf1_application.landingPageID for the 'wcf'
app. Previously it needed to be kept in sync across both tables which didn't
really work well in all cases. Remove this property to gain a single source of
truth for the landing page.

2 years agoCheck the landing page against PageCache::getLandingPage() in PageLocationManager
Tim Düsterhus [Wed, 1 Jun 2022 12:02:03 +0000 (14:02 +0200)]
Check the landing page against PageCache::getLandingPage() in PageLocationManager

The landing page returned by `PageCache` is the landing page as used everywhere
else. Use that one instead of checking the property for consistency.

2 years agoRemove bogus `$menuItem->isLandingPage` check from acp/menuItemAdd.tpl
Tim Düsterhus [Wed, 1 Jun 2022 11:49:24 +0000 (13:49 +0200)]
Remove bogus `$menuItem->isLandingPage` check from acp/menuItemAdd.tpl

This property doesn't exist and even if it would exist, this change would only
be applied in the template, not in PHP. And even if the check would be applied
in PHP, it would not be required. It is perfectly supported to disable all menu
item, including the landing page's. It looks a bit odd, but does not cause
errors.

2 years agoRevert "Reject empty `controller` in ControllerMap::resolveCustomController()"
Tim Düsterhus [Wed, 1 Jun 2022 11:47:55 +0000 (13:47 +0200)]
Revert "Reject empty `controller` in ControllerMap::resolveCustomController()"

The assumptions in the commit message are not currently valid: For a non-i18n
CMS page the RoutingCacheBuilder will clear out the custom URL.

This reverts commit 4a40217a1e5bfe9a2f7d9f4b7c485add6baa7213.

2 years agoMerge pull request #4841 from WoltLab/routing-cleanup
Tim Düsterhus [Wed, 1 Jun 2022 10:17:23 +0000 (12:17 +0200)]
Merge pull request #4841 from WoltLab/routing-cleanup

Further cleanup of the routing logic

2 years agoAdd proper types to ControllerMap::isDefaultController()
Tim Düsterhus [Wed, 1 Jun 2022 10:07:00 +0000 (12:07 +0200)]
Add proper types to ControllerMap::isDefaultController()

2 years agoRemove useless branch in ControllerMap::isDefaultController()
Tim Düsterhus [Wed, 1 Jun 2022 09:30:05 +0000 (11:30 +0200)]
Remove useless branch in ControllerMap::isDefaultController()

The previous change with `str_starts_with()` makes it pretty evident that this
condition is redundant with the regular expression above: The regular
expression also ensures that the `$controller` starts with `__WCF_CMS__` and at
the end of that branch the `$controller` will always be stripped of the
language ID suffix.

2 years agoUse `str_starts_with()` in ControllerMap::isDefaultController()
Tim Düsterhus [Wed, 1 Jun 2022 09:28:33 +0000 (11:28 +0200)]
Use `str_starts_with()` in ControllerMap::isDefaultController()

This replacement is not semantically identical, because the previous version
effectively was a `str_contains()`. However the `__WCF_CMS__` marker always
appears at the start of the string, making the previous version a bug.

2 years agoRemove useless use of `else` in ControllerMap::isDefaultController()
Tim Düsterhus [Wed, 1 Jun 2022 09:26:31 +0000 (11:26 +0200)]
Remove useless use of `else` in ControllerMap::isDefaultController()

The “then” part always returns from the function, thus there is no need for an
explicit `else` here.

2 years agoSimplify `isset()` check in ControllerMap::resolveCustomController()
Tim Düsterhus [Wed, 1 Jun 2022 08:50:18 +0000 (10:50 +0200)]
Simplify `isset()` check in ControllerMap::resolveCustomController()

The first test was a prefix of the second, thus it is implicitly checked.

2 years agoReject empty `controller` in ControllerMap::resolveCustomController()
Tim Düsterhus [Wed, 1 Jun 2022 08:30:55 +0000 (10:30 +0200)]
Reject empty `controller` in ControllerMap::resolveCustomController()

Based on the current callers of this method it is impossible that an empty
string is passed in:

- In LookupRequestRoute the matched controller will always contain a non-slash
  character, unless the URL itself only consists of slashes, which is rejected
  early.
- In ControllerMap::lookupDefaultController() the method will only be called if
  the `routePart` of the landing page matches `__WCF_CMS__` which is only the
  case if the page does not have an controller assigned. In that case the invariant
  that a custom URL must be configured holds and `->lookupCmsPage()` will not
  return an empty controller value.

2 years agoSimplify `isset()` check in ControllerMap::isDefaultController()
Tim Düsterhus [Wed, 1 Jun 2022 07:47:05 +0000 (09:47 +0200)]
Simplify `isset()` check in ControllerMap::isDefaultController()

The first parameter was a prefix of the second, thus it is implicitly checked.

2 years agoMerge branch '5.5'
Tim Düsterhus [Tue, 31 May 2022 14:43:55 +0000 (16:43 +0200)]
Merge branch '5.5'