-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Forms: prevent unauthenticated users from pasting images #20224
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
Forms: prevent unauthenticated users from pasting images #20224
Conversation
@@ -329,7 +329,7 @@ private function applyPredefinedTemplateFields(array $input): array | |||
/** @var \CommonITILObject $itil */ | |||
$itil = new $itemtype(); | |||
$template = $itil->getITILTemplateToUse( | |||
entities_id: $_SESSION["glpiactive_entity"], | |||
entities_id: $_SESSION["glpiactive_entity"] ?? 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The template should be fetched from the target entity (it is configurable in forms).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably have been another PR, but I've fixed it.
src/Glpi/Form/Destination/AbstractCommonITILFormDestination.php
Outdated
Show resolved
Hide resolved
Please fix tests |
Checklist before requesting a review
Description
For unauthenticated forms, disable the
enable_images
settings for textarea questions.