Skip to content

Commit 43c3e63

Browse files
committed
fix(form): drop upload support for public forms
1 parent e24d2fc commit 43c3e63

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

inc/field/filefield.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public function regex($value): bool {
285285
}
286286

287287
public function isPublicFormCompatible(): bool {
288-
return true;
288+
return false;
289289
}
290290

291291
public function getHtmlIcon() {

inc/field/textareafield.class.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ public function getRenderedHtml($domain, $canEdit = true): string {
152152
$fieldName = 'formcreator_field_' . $id;
153153
$value = $this->value;
154154
$html = '';
155+
$form = PluginFormcreatorForm::getByItem($this->getQuestion());
155156
$html .= Html::textarea([
156157
'name' => $fieldName,
157158
'editor_id' => "$fieldName$rand",
@@ -160,6 +161,7 @@ public function getRenderedHtml($domain, $canEdit = true): string {
160161
'rows' => 5,
161162
'display' => false,
162163
'enable_richtext' => true,
164+
'enable_images' => !$form->isPublicAccess(),
163165
'enable_fileupload' => false,
164166
'uploads' => $this->uploads,
165167
]);

0 commit comments

Comments
 (0)