Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
9dbfb722
Commit
9dbfb722
authored
Dec 23, 2018
by
Carsten Rose
Browse files
HelperFile.php: correctRelativePathFileName() broken after refactor of qfq paths. Fixes #7540
parent
c0444b40
Pipeline
#1253
passed with stage
in 1 minute and 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/Source/core/helper/HelperFile.php
View file @
9dbfb722
...
@@ -105,12 +105,16 @@ class HelperFile {
...
@@ -105,12 +105,16 @@ class HelperFile {
public
static
function
getFileStat
(
$pathFileName
)
{
public
static
function
getFileStat
(
$pathFileName
)
{
$vars
=
array
();
$vars
=
array
();
if
(
empty
(
$pathFileName
)
||
!
file_exists
(
$pathFileName
)
)
{
if
(
empty
(
$pathFileName
)
)
{
return
array
();
return
array
();
}
}
$pathFileName
=
self
::
correctRelativPathFileName
(
$pathFileName
);
$pathFileName
=
self
::
correctRelativPathFileName
(
$pathFileName
);
if
(
!
file_exists
(
$pathFileName
)){
return
array
();
}
$vars
[
VAR_FILE_MIME_TYPE
]
=
self
::
getMimeType
(
$pathFileName
);
$vars
[
VAR_FILE_MIME_TYPE
]
=
self
::
getMimeType
(
$pathFileName
);
$vars
[
VAR_FILE_SIZE
]
=
filesize
(
$pathFileName
);
$vars
[
VAR_FILE_SIZE
]
=
filesize
(
$pathFileName
);
...
@@ -133,7 +137,8 @@ class HelperFile {
...
@@ -133,7 +137,8 @@ class HelperFile {
return
$pathFileName
;
return
$pathFileName
;
}
}
if
(
substr
(
getcwd
(),
-
8
)
==
'/'
.
API_DIR_EXT
)
{
$length
=
strlen
(
'/'
.
API_DIR_EXT
);
if
(
substr
(
getcwd
(),
-
$length
)
==
'/'
.
API_DIR_EXT
)
{
return
'../../../../../'
.
$pathFileName
;
return
'../../../../../'
.
$pathFileName
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment