Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443205
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
drupal-3443205
Commits
5dc4ddd9
Commit
5dc4ddd9
authored
13 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#1019470
by benjamin.wss, bfroehle: Ensure that file_directory_temp() works on Windows.
parent
6c410f71
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/file.inc
+8
-4
8 additions, 4 deletions
includes/file.inc
with
8 additions
and
4 deletions
includes/file.inc
+
8
−
4
View file @
5dc4ddd9
...
...
@@ -2348,11 +2348,9 @@ function file_directory_temp() {
if
(
substr
(
PHP_OS
,
0
,
3
)
==
'WIN'
)
{
$directories
[]
=
'c:\\windows\\temp'
;
$directories
[]
=
'c:\\winnt\\temp'
;
$path_delimiter
=
'\\'
;
}
else
{
$directories
[]
=
'/tmp'
;
$path_delimiter
=
'/'
;
}
// PHP may be able to find an alternative tmp directory.
// This function exists in PHP 5 >= 5.2.1, but Drupal
...
...
@@ -2369,8 +2367,14 @@ function file_directory_temp() {
}
if
(
empty
(
$temporary_directory
))
{
// If no directory has been found default to 'files/tmp' or 'files\\tmp'.
$temporary_directory
=
variable_get
(
'file_public_path'
,
conf_path
()
.
'/files'
)
.
$path_delimiter
.
'tmp'
;
// If no directory has been found default to 'files/tmp'.
$temporary_directory
=
variable_get
(
'file_public_path'
,
conf_path
()
.
'/files'
)
.
'/tmp'
;
// Windows accepts paths with either slash (/) or backslash (\), but will
// not accept a path which contains both a slash and a backslash. Since
// the 'file_public_path' variable may have either format, we sanitize
// everything to use slash which is supported on all platforms.
$temporary_directory
=
str_replace
(
'\\'
,
'/'
,
$temporary_directory
);
}
// Save the path of the discovered directory.
variable_set
(
'file_temporary_path'
,
$temporary_directory
);
...
...
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