Issue Bug New Orphaned

#92288Public access can't be denied in GeneratePublicUrlForResourceEvent

Georg Tiefenbrunn 09/11/20, 12:13 updated 09/11/20, 12:13

Description

https://docs.typo3.org/m/typo3/reference-coreapi/10.4/en-us/ApiOverview/Hooks/Events/Core/Resource/GeneratePublicUrlForResourceEvent.html

> Method: setPublicUrl(?string $publicUrl)
> Description: Sets new public URL of resource – or removes public url (by setting null), disallowing public access.

Calling setPublicUrl(null) in an event listener does not disallow public access.

Perhaps GeneratePublicUrlForResourceEvent should implement StoppableEventInterface so we can force publicUrl = null.

As a workaround publicUrl can be set to an empty string (setPublicUrl('')). But that causes false URI generation using core ViewHelpers (e.g. f:uri.image) with absolute="true".

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] Public access can't be denied in GeneratePublicUrlForResourceEvent Resolves: #92288 Releases: main