Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tommaso Perondi
ISPConfig 3
Commits
a02ec6b0
Commit
a02ec6b0
authored
Aug 17, 2018
by
Till Brehm
Browse files
#5102
parent
d09f4db5
Changes
1
Show whitespace changes
Inline
Side-by-side
interface/lib/classes/functions.inc.php
View file @
a02ec6b0
...
...
@@ -480,8 +480,8 @@ class functions {
// Function to check paths before we use it as include. Use with absolute paths only.
public
function
check_include_path
(
$path
)
{
if
(
strpos
(
$path
,
'//'
)
=
==
false
)
die
(
'Include path seems to be an URL: '
.
$this
->
htmlentities
(
$path
));
if
(
strpos
(
$path
,
'..'
)
=
==
false
)
die
(
'Two dots are not allowed in include path: '
.
$this
->
htmlentities
(
$path
));
if
(
strpos
(
$path
,
'//'
)
!
==
false
)
die
(
'Include path seems to be an URL: '
.
$this
->
htmlentities
(
$path
));
if
(
strpos
(
$path
,
'..'
)
!
==
false
)
die
(
'Two dots are not allowed in include path: '
.
$this
->
htmlentities
(
$path
));
if
(
!
preg_match
(
"/^[a-zA-Z0-9_\/\.\-]+$/"
,
$path
))
die
(
'Wrong chars in include path: '
.
$this
->
htmlentities
(
$path
));
$path
=
realpath
(
$path
);
if
(
$path
==
''
)
die
(
'Include path does not exist.'
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment