Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
editor_file
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
editor_file
Commits
21543387
Commit
21543387
authored
2 years ago
by
Rakhi Soni
Committed by
Edouard Cunibil
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3293519
by Rakhi Soni, sourabhjain, DuaelFr: fix Drupal Coding Standards
parent
34fc8b17
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
editor_file.admin.inc
+5
-1
5 additions, 1 deletion
editor_file.admin.inc
src/Form/EditorFileDialog.php
+1
-1
1 addition, 1 deletion
src/Form/EditorFileDialog.php
src/Plugin/CKEditorPlugin/DrupalFile.php
+3
-1
3 additions, 1 deletion
src/Plugin/CKEditorPlugin/DrupalFile.php
with
9 additions
and
3 deletions
editor_file.admin.inc
+
5
−
1
View file @
21543387
...
...
@@ -79,7 +79,11 @@ function editor_file_upload_settings_form(Editor $editor) {
'#title'
=>
t
(
'Allowed file extensions'
),
'#default_value'
=>
$extensions
,
'#description'
=>
t
(
'Separate extensions with a space or comma and do not include the leading dot.'
),
'#element_validate'
=>
[[
'\Drupal\file\Plugin\Field\FieldType\FileItem'
,
'validateExtensions'
]],
'#element_validate'
=>
[
[
'\Drupal\file\Plugin\Field\FieldType\FileItem'
,
'validateExtensions'
,
],
],
'#maxlength'
=>
256
,
// By making this field required, we prevent a potential security issue
// that would allow files of any type to be uploaded.
...
...
This diff is collapsed.
Click to expand it.
src/Form/EditorFileDialog.php
+
1
−
1
View file @
21543387
...
...
@@ -153,7 +153,7 @@ class EditorFileDialog extends FormBase implements BaseFormIdInterface {
$form
[
'attributes'
][
'href'
]
=
[
'#title'
=>
$this
->
t
(
'URL'
),
'#type'
=>
'textfield'
,
'#default_value'
=>
isset
(
$file_element
[
'href'
]
)
?
$file_element
[
'href'
]
:
''
,
'#default_value'
=>
$file_element
[
'href'
]
?:
''
,
'#maxlength'
=>
2048
,
'#required'
=>
TRUE
,
];
...
...
This diff is collapsed.
Click to expand it.
src/Plugin/CKEditorPlugin/DrupalFile.php
+
3
−
1
View file @
21543387
...
...
@@ -67,7 +67,9 @@ class DrupalFile extends CKEditorPluginBase implements CKEditorPluginConfigurabl
$form_state
->
loadInclude
(
'editor_file'
,
'admin.inc'
);
$form
[
'file_upload'
]
=
editor_file_upload_settings_form
(
$editor
);
$form
[
'file_upload'
][
'#attached'
][
'library'
][]
=
'editor_file/drupal.ckeditor.drupalfile.admin'
;
$form
[
'file_upload'
][
'#element_validate'
][]
=
[
$this
,
'validateFileUploadSettings'
];
$form
[
'file_upload'
][
'#element_validate'
][]
=
[
$this
,
'validateFileUploadSettings'
,
];
return
$form
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment