-
Notifications
You must be signed in to change notification settings - Fork 118
Allow custom public share tokens for form links #3311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
557abb5
be327ac
b92f1cc
174a21c
8266216
c86e612
36b8591
74d859b
c216d0a
8a96b09
8d7708a
84b9f62
921a77d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,7 @@ | |
| #[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)] | ||
| class PageController extends Controller { | ||
| private const TEMPLATE_MAIN = 'main'; | ||
| private const PUBLIC_SHARE_HASH_REQUIREMENT = '[a-zA-Z0-9]{8,256}'; | ||
|
Chartman123 marked this conversation as resolved.
Outdated
|
||
|
|
||
| public function __construct( | ||
| string $appName, | ||
|
|
@@ -145,7 +146,7 @@ public function internalLinkView(string $hash): Response { | |
| #[NoAdminRequired()] | ||
| #[NoCSRFRequired()] | ||
| #[PublicPage()] | ||
| #[FrontpageRoute(verb: 'GET', url: '/s/{hash}', requirements: ['hash' => '[a-zA-Z0-9]{24,}'])] | ||
| #[FrontpageRoute(verb: 'GET', url: '/s/{hash}', requirements: ['hash' => self::PUBLIC_SHARE_HASH_REQUIREMENT])] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would probably be good if we can decide here wether custom share tokens are allowed on that instance. But IIRC it's not working with dynamically defined requirements.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Meaning it would be good, but can't be done in this instance? Or should I try? |
||
| public function publicLinkView(string $hash): Response { | ||
| try { | ||
| $share = $this->shareMapper->findPublicShareByHash($hash); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.