Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ISPConfig 3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Helmo
ISPConfig 3
Commits
d09f4db5
Commit
d09f4db5
authored
6 years ago
by
Till Brehm
Browse files
Options
Downloads
Patches
Plain Diff
Finetuning for #5102
parent
6e094613
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
interface/lib/classes/functions.inc.php
+5
-4
5 additions, 4 deletions
interface/lib/classes/functions.inc.php
with
5 additions
and
4 deletions
interface/lib/classes/functions.inc.php
+
5
−
4
View file @
d09f4db5
...
@@ -480,9 +480,9 @@ class functions {
...
@@ -480,9 +480,9 @@ class functions {
// Function to check paths before we use it as include. Use with absolute paths only.
// Function to check paths before we use it as include. Use with absolute paths only.
public
function
check_include_path
(
$path
)
{
public
function
check_include_path
(
$path
)
{
if
(
strpos
(
$path
,
'//'
))
die
(
'Include path seems to be an URL: '
.
$this
->
htmlentities
(
$path
));
if
(
strpos
(
$path
,
'//'
)
===
false
)
die
(
'Include path seems to be an URL: '
.
$this
->
htmlentities
(
$path
));
if
(
strpos
(
$path
,
'..'
))
die
(
'Two dots are not allowed in include path: '
.
$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_\/\.\-]
{
1,
}
$/"
,
$path
))
die
(
'Wrong chars 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
);
$path
=
realpath
(
$path
);
if
(
$path
==
''
)
die
(
'Include path does not exist.'
);
if
(
$path
==
''
)
die
(
'Include path does not exist.'
);
if
(
substr
(
$path
,
0
,
strlen
(
ISPC_ROOT_PATH
))
!=
ISPC_ROOT_PATH
)
die
(
'Path '
.
$this
->
htmlentities
(
$path
)
.
' is outside of ISPConfig installation directory.'
);
if
(
substr
(
$path
,
0
,
strlen
(
ISPC_ROOT_PATH
))
!=
ISPC_ROOT_PATH
)
die
(
'Path '
.
$this
->
htmlentities
(
$path
)
.
' is outside of ISPConfig installation directory.'
);
...
@@ -495,7 +495,8 @@ class functions {
...
@@ -495,7 +495,8 @@ class functions {
if
(
preg_match
(
'/^[a-z]{2}$/'
,
$language
))
{
if
(
preg_match
(
'/^[a-z]{2}$/'
,
$language
))
{
return
$language
;
return
$language
;
}
else
{
}
else
{
die
(
'Invalid language string: '
.
$this
->
htmlentities
(
$language
));
$app
->
log
(
'Wrong language string: '
.
$this
->
htmlentities
(
$language
),
1
);
return
'en'
;
}
}
}
}
...
...
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