Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
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
drupal
Commits
cc2cb795
Commit
cc2cb795
authored
18 years ago
by
Steven Wittens
Browse files
Options
Downloads
Patches
Plain Diff
#101714
: Allow OpenDocument file extensions by default.
parent
dd9d2726
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/upload/upload.module
+3
-3
3 additions, 3 deletions
modules/upload/upload.module
with
3 additions
and
3 deletions
modules/upload/upload.module
+
3
−
3
View file @
cc2cb795
...
@@ -158,7 +158,7 @@ function upload_admin_settings_validate($form_id, $form_values) {
...
@@ -158,7 +158,7 @@ function upload_admin_settings_validate($form_id, $form_values) {
* Menu callback for the upload settings form.
* Menu callback for the upload settings form.
*/
*/
function
upload_admin_settings
()
{
function
upload_admin_settings
()
{
$upload_extensions_default
=
variable_get
(
'upload_extensions_default'
,
'jpg jpeg gif png txt html doc xls pdf ppt pps'
);
$upload_extensions_default
=
variable_get
(
'upload_extensions_default'
,
'jpg jpeg gif png txt html doc xls pdf ppt pps
odt ods odp
'
);
$upload_uploadsize_default
=
variable_get
(
'upload_uploadsize_default'
,
1
);
$upload_uploadsize_default
=
variable_get
(
'upload_uploadsize_default'
,
1
);
$upload_usersize_default
=
variable_get
(
'upload_usersize_default'
,
1
);
$upload_usersize_default
=
variable_get
(
'upload_usersize_default'
,
1
);
...
@@ -423,7 +423,7 @@ function _upload_validate(&$node) {
...
@@ -423,7 +423,7 @@ function _upload_validate(&$node) {
$total_usersize
=
upload_space_used
(
$user
->
uid
)
+
$filesize
;
$total_usersize
=
upload_space_used
(
$user
->
uid
)
+
$filesize
;
$error
=
array
();
$error
=
array
();
foreach
(
$user
->
roles
as
$rid
=>
$name
)
{
foreach
(
$user
->
roles
as
$rid
=>
$name
)
{
$extensions
=
variable_get
(
"upload_extensions_
$rid
"
,
variable_get
(
'upload_extensions_default'
,
'jpg jpeg gif png txt html doc xls pdf ppt pps'
));
$extensions
=
variable_get
(
"upload_extensions_
$rid
"
,
variable_get
(
'upload_extensions_default'
,
'jpg jpeg gif png txt html doc xls pdf ppt pps
odt ods odp
'
));
$uploadsize
=
variable_get
(
"upload_uploadsize_
$rid
"
,
variable_get
(
'upload_uploadsize_default'
,
1
))
*
1024
*
1024
;
$uploadsize
=
variable_get
(
"upload_uploadsize_
$rid
"
,
variable_get
(
'upload_uploadsize_default'
,
1
))
*
1024
*
1024
;
$usersize
=
variable_get
(
"upload_usersize_
$rid
"
,
variable_get
(
'upload_usersize_default'
,
1
))
*
1024
*
1024
;
$usersize
=
variable_get
(
"upload_usersize_
$rid
"
,
variable_get
(
'upload_usersize_default'
,
1
))
*
1024
*
1024
;
...
@@ -641,7 +641,7 @@ function upload_munge_filename($filename, $extensions = NULL, $alerts = 1) {
...
@@ -641,7 +641,7 @@ function upload_munge_filename($filename, $extensions = NULL, $alerts = 1) {
if
(
!
isset
(
$extensions
))
{
if
(
!
isset
(
$extensions
))
{
$extensions
=
''
;
$extensions
=
''
;
foreach
(
$user
->
roles
as
$rid
=>
$name
)
{
foreach
(
$user
->
roles
as
$rid
=>
$name
)
{
$extensions
.
=
' '
.
variable_get
(
"upload_extensions_
$rid
"
,
variable_get
(
'upload_extensions_default'
,
'jpg jpeg gif png txt html doc xls pdf ppt pps'
));
$extensions
.
=
' '
.
variable_get
(
"upload_extensions_
$rid
"
,
variable_get
(
'upload_extensions_default'
,
'jpg jpeg gif png txt html doc xls pdf ppt pps
odt ods odp
'
));
}
}
}
}
...
...
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