GitHub/WoltLab/WCF.git
2 years agoMerge branch '5.5'
Tim Düsterhus [Fri, 1 Jul 2022 11:54:59 +0000 (13:54 +0200)]
Merge branch '5.5'

2 years agoUpdate focus-trap and tabbable
Tim Düsterhus [Fri, 1 Jul 2022 11:52:26 +0000 (13:52 +0200)]
Update focus-trap and tabbable

2 years agoMerge branch '5.5'
Tim Düsterhus [Fri, 1 Jul 2022 11:51:17 +0000 (13:51 +0200)]
Merge branch '5.5'

2 years agoMerge branch '5.4' into 5.5
Tim Düsterhus [Fri, 1 Jul 2022 11:49:20 +0000 (13:49 +0200)]
Merge branch '5.4' into 5.5

2 years agoUpdate typescript
Tim Düsterhus [Fri, 1 Jul 2022 11:44:06 +0000 (13:44 +0200)]
Update typescript

see 41b5a7f4fcc27a2fd4434d2feedb10e942930d51. We specifically upgrade
typescript also in 5.4 to ease merges, because the output of const enum
changed.

2 years agoUpdate gsactions/commit-message-checker
Tim Düsterhus [Fri, 1 Jul 2022 09:44:29 +0000 (11:44 +0200)]
Update gsactions/commit-message-checker

2 years agoUpdate npm dependencies
Tim Düsterhus [Fri, 1 Jul 2022 09:33:18 +0000 (11:33 +0200)]
Update npm dependencies

2 years agoPreserve the content when removing selection markers
Alexander Ebert [Thu, 30 Jun 2022 15:28:18 +0000 (17:28 +0200)]
Preserve the content when removing selection markers

In some rare cases the typed-in content could be placed within the selection markers, causing those to be removed whenever markers are being stripped.

This is a follow up for dd829b643d403f403fae8748a8f00e2e448af490 which already mitigates some of these issues by more carefully handling selections.

2 years agoMerge pull request #4883 from WoltLab/main-menu-data-binding
Alexander Ebert [Thu, 30 Jun 2022 14:30:19 +0000 (16:30 +0200)]
Merge pull request #4883 from WoltLab/main-menu-data-binding

Partial Data Binding for the Main Menu

2 years agoUse the `null` value to indicate a missing identifier
Alexander Ebert [Thu, 30 Jun 2022 13:55:24 +0000 (15:55 +0200)]
Use the `null` value to indicate a missing identifier

2 years agoMerge pull request #4884 from WoltLab/diactoros-requestFilter
Tim Düsterhus [Thu, 30 Jun 2022 10:50:37 +0000 (12:50 +0200)]
Merge pull request #4884 from WoltLab/diactoros-requestFilter

Explicitly trust `x-forwarded-proto` for Diactoros' ServerRequest

2 years agoSpecify `null` for the superglobals in ServerRequestFactory::fromGlobals()
Tim Düsterhus [Thu, 30 Jun 2022 09:44:51 +0000 (11:44 +0200)]
Specify `null` for the superglobals in ServerRequestFactory::fromGlobals()

Diactoros does not use `$_COOKIE` internally, but parses the `Cookie` header
instead, because PHP mangles cookie names when parsing into `$_COOKIE`.

2 years agoDo not use named parameters for ServerRequestFactory::fromGlobals()
Tim Düsterhus [Thu, 30 Jun 2022 09:41:00 +0000 (11:41 +0200)]
Do not use named parameters for ServerRequestFactory::fromGlobals()

Laminas does not guarantee backwards compatibility for parameter names.

2 years agoExplicitly trust `x-forwarded-proto` for Diactoros' ServerRequest
Tim Düsterhus [Thu, 30 Jun 2022 08:49:42 +0000 (10:49 +0200)]
Explicitly trust `x-forwarded-proto` for Diactoros' ServerRequest

This is required to future-proof the Diactoros configuration to be consistent
with RouteHandler::secureConnection().

see https://github.com/laminas/laminas-diactoros/blob/c272a93fc716456599d26bf7cc3281ccb708dabf/docs/book/v2/forward-migration.md

2 years agoSync the unread counters of the main menu and the mobile menu
Alexander Ebert [Wed, 29 Jun 2022 16:23:13 +0000 (18:23 +0200)]
Sync the unread counters of the main menu and the mobile menu

2 years agoExpose the identifier of a menu item
Alexander Ebert [Wed, 29 Jun 2022 15:32:48 +0000 (17:32 +0200)]
Expose the identifier of a menu item

2 years agoMerge branch '5.5'
Tim Düsterhus [Wed, 29 Jun 2022 15:05:05 +0000 (17:05 +0200)]
Merge branch '5.5'

2 years agoTighten up composer constraints
Tim Düsterhus [Wed, 29 Jun 2022 15:04:29 +0000 (17:04 +0200)]
Tighten up composer constraints

2 years agoClose the mobile navigation drop-down on page scroll
Alexander Ebert [Wed, 29 Jun 2022 14:44:30 +0000 (16:44 +0200)]
Close the mobile navigation drop-down on page scroll

All drop-down menus are expected to close whenever the page is being scrolled. This is implemented for regular drop-down menus, but this one bypasses the general API.

See https://www.woltlab.com/community/thread/296092-fenster-zitieren-inhalt-melden-%C3%BCberlagert-men%C3%BC-mobil/

2 years agoUpdate composer dependencies
Tim Düsterhus [Wed, 29 Jun 2022 14:17:09 +0000 (16:17 +0200)]
Update composer dependencies

This fixes a Diactoros regression in e707bb4c8f19bd627f06738e64e5c823f88dc4f7.

2 years agoDelay the auto focus of the submit button
Alexander Ebert [Wed, 29 Jun 2022 13:47:47 +0000 (15:47 +0200)]
Delay the auto focus of the submit button

Safari delays the execution of the `blur` event on the document which causes the focus shift to happen too early.

Delaying it by two event cycles are enough to provide a consistent experience and to avoid conflicts with the focus trap.

See https://www.woltlab.com/community/thread/296069-best%C3%A4tigung-bei-installation-von-paket-%C3%BCber-entwickler-werkzeuge-nicht-direkt-pe/

2 years agoPreserve the minimum height of the user header without ranks
Alexander Ebert [Wed, 29 Jun 2022 13:29:06 +0000 (15:29 +0200)]
Preserve the minimum height of the user header without ranks

The `.userMenuItemSingleLine` class is shared with other elements that are not as tall as the user header.

The `min-height: 0` will cause the user header to collapse too much when the user rank module is disabled.

See https://www.woltlab.com/community/thread/296134-darstellungsfehler-im-kontrollzentrum-ohne-rangmodul/

2 years agoFix missing check if conditions are available when adding a box
Marcel Werk [Wed, 29 Jun 2022 13:26:29 +0000 (15:26 +0200)]
Fix missing check if conditions are available when adding a box

2 years agoMerge branch '5.5' of https://github.com/WoltLab/WCF into 5.5
Marcel Werk [Wed, 29 Jun 2022 13:16:29 +0000 (15:16 +0200)]
Merge branch '5.5' of https://github.com/WoltLab/WCF into 5.5

2 years agoMerge branch '5.5'
Tim Düsterhus [Wed, 29 Jun 2022 12:49:14 +0000 (14:49 +0200)]
Merge branch '5.5'

2 years agoEnsure that avatars are world-readable in UserProfileAction::setAvatar()
Tim Düsterhus [Wed, 29 Jun 2022 12:45:37 +0000 (14:45 +0200)]
Ensure that avatars are world-readable in UserProfileAction::setAvatar()

Fixes #4769

2 years agoUpdate composer dependencies
Tim Düsterhus [Wed, 29 Jun 2022 10:18:08 +0000 (12:18 +0200)]
Update composer dependencies

2 years agoMerge branch '5.5'
Tim Düsterhus [Wed, 29 Jun 2022 10:16:02 +0000 (12:16 +0200)]
Merge branch '5.5'

2 years agoMerge branch '5.5' of https://github.com/WoltLab/WCF into 5.5
Marcel Werk [Tue, 28 Jun 2022 14:01:24 +0000 (16:01 +0200)]
Merge branch '5.5' of https://github.com/WoltLab/WCF into 5.5

2 years agoFix missing twitter icon
Marcel Werk [Tue, 28 Jun 2022 14:01:22 +0000 (16:01 +0200)]
Fix missing twitter icon

2 years agoMerge pull request #4882 from WoltLab/secure-package-download
Alexander Ebert [Tue, 28 Jun 2022 12:45:30 +0000 (14:45 +0200)]
Merge pull request #4882 from WoltLab/secure-package-download

Improve the Security of the Plugin-Store StoreCode

2 years agoClearly mark the StoreCode as sensitive
Alexander Ebert [Tue, 28 Jun 2022 12:10:20 +0000 (14:10 +0200)]
Clearly mark the StoreCode as sensitive

The Plugin-Store StoreCode can contain credentials that are considered to be sensitive and should not be shared with third parties.

This change adds a unique prefix that serves as a warning to prevent users from unintentionally sharing these credentials with others.

In addition, this unique prefix makes it possible to block this string from appearing in messages using the censorship feature.

2 years agoGuarantee integrity of packages downloaded via a Plugin-Store StoreCode
Alexander Ebert [Tue, 28 Jun 2022 11:06:20 +0000 (13:06 +0200)]
Guarantee integrity of packages downloaded via a Plugin-Store StoreCode

The package system was unaware of the context of an installation request and permitted the download from unintended package servers.

This can cause the download to be initiated from a different server than the user expected, potentially causing the download of a modified version.

This commit fixes this issue by restricting the package sources to official servers only when the download via the Plugin-Store‘s StoreCode is requested.

2 years agoExplicitly define the text color in the mobile menu
Alexander Ebert [Tue, 28 Jun 2022 12:17:31 +0000 (14:17 +0200)]
Explicitly define the text color in the mobile menu

The elements previously implicitly inherited the text color from the surrounding HTML context rather than the element itself. This caused the colors from the content area to bleed into the mobile menu.

See https://www.woltlab.com/community/thread/295243-pro-und-kontra-neues-kontrollzentrum/?postID=1897430#post1897430 ff

2 years agoMerge pull request #4881 from WoltLab/controller-transform
Tim Düsterhus [Mon, 27 Jun 2022 17:04:11 +0000 (19:04 +0200)]
Merge pull request #4881 from WoltLab/controller-transform

Use ControllerMap::transformController() in RoutingCacheBuilder::getCaseInsensitiveControllers()

2 years agoForce restore saved selections after inserting links into the editor
Alexander Ebert [Mon, 27 Jun 2022 16:53:37 +0000 (18:53 +0200)]
Force restore saved selections after inserting links into the editor

Redactor‘s selection handling is very fragile and “forgetting” to restore the selection can cause some very strange side-effects.

The user will start typing inside a selection marker, which will not cause any visual effects, but the content will get lost once the editor removes the markers.

See https://www.woltlab.com/community/thread/296022-einf%C3%BCgen-von-links-im-editor-unter-ipados/
See https://www.woltlab.com/community/thread/296116-einf%C3%BCgen-von-links-im-editor-unter-ipados-text-verschwindet/
See https://www.woltlab.com/community/thread/294753-text-wird-beim-speichern-abgeschnitten/

2 years agoMerge branch '5.5' of https://github.com/WoltLab/WCF into 5.5
Marcel Werk [Mon, 27 Jun 2022 16:04:38 +0000 (18:04 +0200)]
Merge branch '5.5' of https://github.com/WoltLab/WCF into 5.5

2 years agoFix sorting of articles by number of comments
Marcel Werk [Mon, 27 Jun 2022 16:04:37 +0000 (18:04 +0200)]
Fix sorting of articles by number of comments

Sorting by comments resulted in an exception because the comments column is no longer present in the article table.

2 years agoDelegate to ->classNameToControllerName() in RoutingCacheBuilder::getCaseInsensitiveC...
Tim Düsterhus [Mon, 27 Jun 2022 15:00:37 +0000 (17:00 +0200)]
Delegate to ->classNameToControllerName() in RoutingCacheBuilder::getCaseInsensitiveControllers()

2 years agoStrengthen check for non-instantiable classes in ControllerMap::getClassData()
Tim Düsterhus [Mon, 27 Jun 2022 14:56:56 +0000 (16:56 +0200)]
Strengthen check for non-instantiable classes in ControllerMap::getClassData()

2 years agoCall `\strtolower()` only once in ControllerMap::transformController()
Tim Düsterhus [Mon, 27 Jun 2022 13:21:14 +0000 (15:21 +0200)]
Call `\strtolower()` only once in ControllerMap::transformController()

2 years agoUse ControllerMap::transformController() in RoutingCacheBuilder::getCaseInsensitiveCo...
Tim Düsterhus [Mon, 27 Jun 2022 13:10:54 +0000 (15:10 +0200)]
Use ControllerMap::transformController() in RoutingCacheBuilder::getCaseInsensitiveControllers()

The implementation is absolutely identical and thus can and should be unified.

A behavioral change without any externally visible effect is introduced: For
`TAJAXException` the last part (`Exception`) is no longer stripped. This is
completely irrelevant, as `ControllerMap::getLegacyClassData()` ignores all
classNames that do not end in Action, Form, or Page.

2 years agoRemove obsolete property accesss in RoutingCacheBuilder::getCaseInsensitiveControllers()
Tim Düsterhus [Mon, 27 Jun 2022 14:53:07 +0000 (16:53 +0200)]
Remove obsolete property accesss in RoutingCacheBuilder::getCaseInsensitiveControllers()

see b9d282d542780d231c3ffe79a6eb8b1bcabf0bd6

2 years agoMerge pull request #4880 from WoltLab/broken-controller
Tim Düsterhus [Mon, 27 Jun 2022 12:55:51 +0000 (14:55 +0200)]
Merge pull request #4880 from WoltLab/broken-controller

Stop faking custom URLs for controllers classes with exactly two consecutive uppercase characters

2 years agoStop faking custom URLs for controllers classes with exactly two consecutive uppercas...
Tim Düsterhus [Mon, 27 Jun 2022 12:10:10 +0000 (14:10 +0200)]
Stop faking custom URLs for controllers classes with exactly two consecutive uppercase characters

This was introduced in 519f15c7700222357952e8cab41bbe960730c7fd and its purpose
is not entirely clear: Everything works identically even without this, even in
WoltLab Suite 5.5.

RoutingCacheBuilder is only ever used within ControllerMap and within
ControllerMap there are just a few locations where custom URLs are processed:

- resolve(): This enforces that renamed controllers are accessed via their
  canonical URL. Not relevant here, because we are already working with the
  canonical URL and it's not an intentional rename.
- resolveCustomController(): This is what we intent to avoid. If this method
  does not match, then `->resolve()` will correctly match.
- lookup(): `self::transformController()` will perform the correct
  transformation.
- lookupCmsPage(): Not relevant, because we do not deal with CMS pages.

2 years agoUse `/` as regex delimiter in ControllerMap to enable syntax highlighting in IDE
Tim Düsterhus [Mon, 27 Jun 2022 11:38:29 +0000 (13:38 +0200)]
Use `/` as regex delimiter in ControllerMap to enable syntax highlighting in IDE

2 years agoMerge pull request #4879 from WoltLab/tmp-fallback-remove
Tim Düsterhus [Mon, 27 Jun 2022 11:23:13 +0000 (13:23 +0200)]
Merge pull request #4879 from WoltLab/tmp-fallback-remove

Remove fallbacks from FileUtil::getTempFolder()

2 years agoRemove fallbacks from FileUtil::getTempFolder()
Tim Düsterhus [Mon, 27 Jun 2022 10:15:32 +0000 (12:15 +0200)]
Remove fallbacks from FileUtil::getTempFolder()

The temporary folder within WCF_DIR is automatically created during WCFSetup
when the `.htaccess` is extracted. Based on how the method's written, it is
exceedingly unlikely that the system's temporary folder is used and it
indicates a severe misconfiguration. Remove the fallback for simplicity.

see e41dfd007b12baed65ab7679fb679e53bcd2adf5

2 years agoMerge pull request #4873 from WoltLab/lookup-request-route-wcf-fallback
Tim Düsterhus [Mon, 27 Jun 2022 09:40:02 +0000 (11:40 +0200)]
Merge pull request #4873 from WoltLab/lookup-request-route-wcf-fallback

Remove fallback to 'wcf' in LookupRequestRoute

2 years agoMerge pull request #4876 from WoltLab/controllermap-custom-url-redirect
Tim Düsterhus [Mon, 27 Jun 2022 09:39:55 +0000 (11:39 +0200)]
Merge pull request #4876 from WoltLab/controllermap-custom-url-redirect

Remove fallback to wcf's custom URLs in ControllerMap::resolve()

2 years agoMerge pull request #4875 from WoltLab/sensitive-parameter-value
Tim Düsterhus [Mon, 27 Jun 2022 09:08:57 +0000 (11:08 +0200)]
Merge pull request #4875 from WoltLab/sensitive-parameter-value

Use \SensitiveParameterValue as the replacement value in exception handling

2 years agoFix typo in parameter type name in ControllerMap
Tim Düsterhus [Fri, 24 Jun 2022 12:19:39 +0000 (14:19 +0200)]
Fix typo in parameter type name in ControllerMap

see a3ae99cdfc70906b0ffffa51df4e3a060141dff2

2 years agoAdd proper types to ControllerMap
Tim Düsterhus [Fri, 24 Jun 2022 12:16:36 +0000 (14:16 +0200)]
Add proper types to ControllerMap

2 years agoRemove fallback to wcf's custom URLs in ControllerMap::resolve()
Tim Düsterhus [Fri, 24 Jun 2022 10:02:10 +0000 (12:02 +0200)]
Remove fallback to wcf's custom URLs in ControllerMap::resolve()

This fallback was introduced in the very first version of the forced redirect
to the custom URL for requests that directly request the controller class name
in c2de61fb187cf357cd9653693a8fa7cad39ca6ef.

However this might make controllers entirely inaccessible, because the custom
URLs are scoped to the application without any fallback to 'wcf'. This is
reproducible even in the 5.5 branch before the refactoring of the routing
logic.

Consider the following example:

- 'wcf' has the AccountManagementForm
- 'blog' also has an AccountManagement controller
- wcf's AccountManagementForm has the custom controller 'kontoverwaltung'

Now the following happens:

- Links to wcf's AccountManagement will be generated as /index.php?kontoverwaltung
- Links to blog's AccountManagement will be generated as /blog/index.php?account-management

So far so good, this is the expected behavior. Further:

- Accessing /index.php?account-management redirects to /index.php?kontoverwaltung

This is correct: The canonical URL is 'kontoverwaltung' and the page loads, however:

- Accessing /blog/index.php?account-management redirects to /blog/index.php?kontoverwaltung

This is not correct: The blog does not have a custom controller
'kontoverwaltung'. Due to the fallback in LookupRequestRoute, this will route
to wcf's AccountManagement. This fallback will be removed in PR #4873. If that
PR is merged, then instead of routing to wcf's AccountManagement, this will
result in a 404.

Either way: Blog's AccountManagement will be entirely inaccessible and
LinkHandler will generate broken links.

Fix this by removing this incorrect fallback. Accessing
/blog/index.php?account-management will now behave as if wcf's
AccountManagement wasn't renamed.

2 years agoMerge branch '5.5'
Tim Düsterhus [Fri, 24 Jun 2022 09:47:14 +0000 (11:47 +0200)]
Merge branch '5.5'

2 years agoMerge pull request #4874 from WoltLab/routeData-is-default-controller
Tim Düsterhus [Fri, 24 Jun 2022 09:31:01 +0000 (11:31 +0200)]
Merge pull request #4874 from WoltLab/routeData-is-default-controller

Clean up RequestHandler::buildRequest()

2 years agoUse \SensitiveParameterValue as the replacement value in exception handling
Tim Düsterhus [Fri, 24 Jun 2022 09:02:04 +0000 (11:02 +0200)]
Use \SensitiveParameterValue as the replacement value in exception handling

Use the standard PHP 8.2 replacement value, instead of the `[redacted]` string
for consistency. This works as expected, because `SensitiveParameterValue` is
polyfilled.

2 years agoRefresh the mobile unread indicator on DOM update
Alexander Ebert [Thu, 23 Jun 2022 16:56:28 +0000 (18:56 +0200)]
Refresh the mobile unread indicator on DOM update

The unread indicator might become out of sync if the menu is closed, but an action causes the last remaining element(s) to be marked as read.

Using a `MutationObserver` removes the need of signaling such change directly by all actions, for example a “Mark All as Read” button.

See https://www.woltlab.com/community/thread/296063-alle-als-gelesen-markieren-entfernt-badge-nicht/

2 years agoDetect active menu items that have no children
Alexander Ebert [Thu, 23 Jun 2022 16:31:05 +0000 (18:31 +0200)]
Detect active menu items that have no children

Links with children have the `active` class set on them, but links without have it placed on the parent instead.

See https://www.woltlab.com/community/thread/296045-mobiles-hauptmen%C3%BC-teilweise-nicht-vorausgew%C3%A4hlt-wenn-man-auf-einer-unterseite-is/

2 years agoRemove `isDefaultController` from request metadata
Tim Düsterhus [Thu, 23 Jun 2022 15:04:24 +0000 (17:04 +0200)]
Remove `isDefaultController` from request metadata

This is currently unused and its value is questionable at best.

2 years agoStop adding the `isDefaultController` value to `$routeData` in RequestHandler
Tim Düsterhus [Thu, 23 Jun 2022 15:00:26 +0000 (17:00 +0200)]
Stop adding the `isDefaultController` value to `$routeData` in RequestHandler

The `$routeData` array is only processed locally, except when it is passed to
LinkHandler for renamed controllers (which can't happen for default
controllers), thus this is completely redundant with simply checking
`->isDefaultController()` in the other places, with the latter being much more
clear, because one does not need to think about where the `$routeData` might
end up.

2 years agoEnsure that RouteHandler strips the `isDefaultController` key from $routeData
Tim Düsterhus [Thu, 23 Jun 2022 14:53:50 +0000 (16:53 +0200)]
Ensure that RouteHandler strips the `isDefaultController` key from $routeData

2 years agoMerge pull request #4872 from WoltLab/request-route-cleanup
Tim Düsterhus [Thu, 23 Jun 2022 13:36:23 +0000 (15:36 +0200)]
Merge pull request #4872 from WoltLab/request-route-cleanup

Clean up route implementation

2 years agoMark LookupRequestRoute as final
Tim Düsterhus [Thu, 23 Jun 2022 12:37:51 +0000 (14:37 +0200)]
Mark LookupRequestRoute as final

2 years agoInline DynamicRequestRoute::getControllerName()
Tim Düsterhus [Thu, 23 Jun 2022 12:15:50 +0000 (14:15 +0200)]
Inline DynamicRequestRoute::getControllerName()

2 years agoRemove fallback to 'wcf' in LookupRequestRoute
Tim Düsterhus [Thu, 23 Jun 2022 13:12:24 +0000 (15:12 +0200)]
Remove fallback to 'wcf' in LookupRequestRoute

This fallback exists since c2de61fb187cf357cd9653693a8fa7cad39ca6ef which is
the first commit which made custom URLs actually functional.

The purpose of this fallback is unclear, it might be related to 'wcf' not
having its own frontend before WoltLab Suite 3.0 and logic expecting that wcf
controllers are accessible from any app.

What's certain is, that this fallback is pretty intransparent, because it:

1) Only affects custom URLs.
2) Only affects controllers assigned to the 'wcf' app.
3) Only affects controllers where the accessed application does not have the
   same customURL in its inventory.

Consider this example:

- 'wcf', 'wbb' and 'blog' are installed.
- wcf's AccountManagement is renamed to `my-controller`
- wbb's WatchedThreadList is also renamed to `my-controller`
- blog is left as is

Now accessing:

- `/index.php?my-controller` goes to AccountManagement
- `/blog/index.php?my-controller` goes to AccountManagement
- `/forum/index.php?my-controller` goes to … WatchedThreadList

which most certainly violates the user's expectations.

See also 4da8c1de463ca71f09d284f3529c1d499a7ac8f8 which adjusts a very similar
feature.

2 years agoPreserve the scroll position in CodeMirror on navigation
Alexander Ebert [Thu, 23 Jun 2022 13:21:43 +0000 (15:21 +0200)]
Preserve the scroll position in CodeMirror on navigation

The previous code stopped working after the update of CodeMirror.

See https://www.woltlab.com/community/thread/296010-nach-css-%C3%A4nderung-nicht-an-selber-stelle/

2 years agoExplicitly implement StaticRequestRoute::isACP()
Tim Düsterhus [Thu, 23 Jun 2022 12:11:34 +0000 (14:11 +0200)]
Explicitly implement StaticRequestRoute::isACP()

The removes dependencies on the implementation in DynamicRequestRoute, possibly
allowing StaticRequestRoute to not inherit from DynamicRequestRoute in the
future.

2 years agoRemove LookupRequestRoute::setIsACP()
Tim Düsterhus [Thu, 23 Jun 2022 12:09:37 +0000 (14:09 +0200)]
Remove LookupRequestRoute::setIsACP()

This method always throws and is no longer required by the interface.

2 years agoRemove IRequestRoute::setIsACP()
Tim Düsterhus [Thu, 23 Jun 2022 12:07:48 +0000 (14:07 +0200)]
Remove IRequestRoute::setIsACP()

This is not a method that can usefully be generically called, because one needs
to know how the properties of the route implementation to usefully modify it.
There are already route implementations that always throw in this method.

2 years agoImprove typing in RequestHandler
Tim Düsterhus [Thu, 23 Jun 2022 12:00:06 +0000 (14:00 +0200)]
Improve typing in RequestHandler

2 years agoRemove obsolete import
Tim Düsterhus [Thu, 23 Jun 2022 11:56:03 +0000 (13:56 +0200)]
Remove obsolete import

see fd99dc13a68da8f29a5c17ec5d564672304fc7dd

2 years agoInline RequestHandler::redirect()
Tim Düsterhus [Thu, 23 Jun 2022 11:52:22 +0000 (13:52 +0200)]
Inline RequestHandler::redirect()

see d8b9780a06174bee45b7e911b945ce5644259146

2 years agoMerge branch '5.4' into 5.5
Alexander Ebert [Thu, 23 Jun 2022 11:34:40 +0000 (13:34 +0200)]
Merge branch '5.4' into 5.5

2 years agoBind event listeners on editor elements only once
Alexander Ebert [Thu, 23 Jun 2022 11:32:27 +0000 (13:32 +0200)]
Bind event listeners on editor elements only once

The previous code caused the event listeners to be bound with every iteration. Every invocation touches the DOM by updating the title, which in return caused `observe.load()` to be triggered again. This causes the number of bound event listeners (and thus DOM updates!) to increase exponentionally.

See https://www.woltlab.com/community/thread/296068-dialog-container-vom-spoiler-tag-kann-das-forum-aufh%C3%A4ngen/

2 years agoMerge pull request #4871 from WoltLab/route-data
Tim Düsterhus [Wed, 22 Jun 2022 15:11:00 +0000 (17:11 +0200)]
Merge pull request #4871 from WoltLab/route-data

Clean up default controller processing

2 years agoImprove RequestHandler::buildRequest()'s control flow
Tim Düsterhus [Wed, 22 Jun 2022 14:37:17 +0000 (16:37 +0200)]
Improve RequestHandler::buildRequest()'s control flow

Perform the default controller processing within a single block, instead of
first branching based on whether the ACP or frontend was accessed.

2 years agoUnify the handling of the default controller for ACP requests
Tim Düsterhus [Wed, 22 Jun 2022 14:33:56 +0000 (16:33 +0200)]
Unify the handling of the default controller for ACP requests

2 years agoEnforce that routes return a controller name XOR the default controller
Tim Düsterhus [Wed, 22 Jun 2022 14:32:10 +0000 (16:32 +0200)]
Enforce that routes return a controller name XOR the default controller

It is not useful to return both a name and pretending that it's the default
controller, as the controller name would be overriden anyway.

see 5da310cc32d5300cb393dd127ce5ec7abc9315bf

2 years agoMerge pull request #4869 from WoltLab/handle-default-controller
Tim Düsterhus [Wed, 22 Jun 2022 15:03:15 +0000 (17:03 +0200)]
Merge pull request #4869 from WoltLab/handle-default-controller

Remove dead branch in RequestHandler::handleDefaultController()

2 years agoInline RequestHandler::handleDefaultController()
Tim Düsterhus [Wed, 22 Jun 2022 14:01:46 +0000 (16:01 +0200)]
Inline RequestHandler::handleDefaultController()

This makes the data flow easier to grasp, as one does not need to jump around
in the file.

2 years agoRemove dead branch in RequestHandler::handleDefaultController()
Tim Düsterhus [Wed, 22 Jun 2022 13:48:41 +0000 (15:48 +0200)]
Remove dead branch in RequestHandler::handleDefaultController()

It turns out that that the third and last remaining change of
000c0c8a26491708b2af995bdd6f0e627cc75161 is also broken.

After effectively reverting / removing the logic in the other two files
modified by that commit in e0976fcfdbeeafc80bc202f80ae2f946326d465d and
416dafddb18a3e82750c6e8ca089d4f9132b39dc, this commit cleans up the last
change.

Since 000c0c8a26491708b2af995bdd6f0e627cc75161 is is impossible for this
redirect to happen and the reason is simple:

The logic will only ever be executed for non-CMS pages, as these are the only
ones where `->lookupDefaultController()` returns an application.

The `controller` return value of `->lookupDefaultController()` will contain the
`routePart` (i.e. `board-list`). However the application overrides are keyed by
the controller name (i.e. `BoardList`), causing the lookup to always fail,
resulting in the given `$application` being returned as-is in `$override`. As
both values are identical, the branch will never be taken and the redirect will
never be executed.

2 years agoReplace emptiness check of $this->routeData with strict comparison in LookupRequestRoute
Tim Düsterhus [Wed, 22 Jun 2022 13:33:56 +0000 (15:33 +0200)]
Replace emptiness check of $this->routeData with strict comparison in LookupRequestRoute

2 years agoAdd return type to ControllerMap::resolveCustomController()
Tim Düsterhus [Wed, 22 Jun 2022 13:32:44 +0000 (15:32 +0200)]
Add return type to ControllerMap::resolveCustomController()

2 years agoRename local `$controller` to `$routePart` in ControllerMap::lookupDefaultController()
Tim Düsterhus [Wed, 22 Jun 2022 13:26:02 +0000 (15:26 +0200)]
Rename local `$controller` to `$routePart` in ControllerMap::lookupDefaultController()

2 years agoMake usage of ControllerMap::$landingPages easier to inspect
Tim Düsterhus [Wed, 22 Jun 2022 12:57:47 +0000 (14:57 +0200)]
Make usage of ControllerMap::$landingPages easier to inspect

By removing the use of the local variable one can simple search for
$this->landingPages to find all locations.

2 years agoMark ControllerMap as final
Tim Düsterhus [Wed, 22 Jun 2022 12:53:59 +0000 (14:53 +0200)]
Mark ControllerMap as final

2 years agoFix appearance of content navigation buttons in mobile version
Marcel Werk [Tue, 21 Jun 2022 13:31:13 +0000 (15:31 +0200)]
Fix appearance of content navigation buttons in mobile version

Buttons went beyond the edge of the screen instead of wrapping.

2 years agoReinstall all composer packages
Tim Düsterhus [Tue, 21 Jun 2022 09:02:11 +0000 (11:02 +0200)]
Reinstall all composer packages

2 years agoTighten up composer constraints
Tim Düsterhus [Tue, 21 Jun 2022 09:00:38 +0000 (11:00 +0200)]
Tighten up composer constraints

2 years agoMerge branch '5.5'
Tim Düsterhus [Tue, 21 Jun 2022 08:59:31 +0000 (10:59 +0200)]
Merge branch '5.5'

2 years agoMerge remote-tracking branch 'origin/5.5' into 5.5
Tim Düsterhus [Tue, 21 Jun 2022 08:58:32 +0000 (10:58 +0200)]
Merge remote-tracking branch 'origin/5.5' into 5.5

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

2 years agoMerge branch '5.3' into 5.4
Tim Düsterhus [Tue, 21 Jun 2022 08:57:19 +0000 (10:57 +0200)]
Merge branch '5.3' into 5.4

2 years agoUpdate Guzzle
Tim Düsterhus [Tue, 21 Jun 2022 08:52:30 +0000 (10:52 +0200)]
Update Guzzle

see guzzle/guzzle@a52f0440530b54fa079ce76e8c5d196a42cad981

2 years agoMerge branch '5.4' into 5.5
Tim Düsterhus [Tue, 21 Jun 2022 08:48:28 +0000 (10:48 +0200)]
Merge branch '5.4' into 5.5

2 years agoMerge branch '5.3' into 5.4
Tim Düsterhus [Tue, 21 Jun 2022 08:47:11 +0000 (10:47 +0200)]
Merge branch '5.3' into 5.4

2 years agoUpdate guzzlehttp/psr7
Tim Düsterhus [Tue, 21 Jun 2022 08:44:38 +0000 (10:44 +0200)]
Update guzzlehttp/psr7

This is a dependency for an updated Guzzle.

see guzzle/psr7@e98e3e6d4f86621a9b75f623996e6bbdeb4b9318
see guzzle/guzzle@a52f0440530b54fa079ce76e8c5d196a42cad981

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

2 years agoMerge branch '5.3' into 5.4
Tim Düsterhus [Tue, 21 Jun 2022 08:43:19 +0000 (10:43 +0200)]
Merge branch '5.3' into 5.4