Skip to content

Commit d09f4db

Browse files
author
Till Brehm
committed
Finetuning for #5102
1 parent 6e09461 commit d09f4db

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

interface/lib/classes/functions.inc.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,9 @@ public function htmlentities($value) {
480480

481481
// Function to check paths before we use it as include. Use with absolute paths only.
482482
public function check_include_path($path) {
483-
if(strpos($path,'//')) die('Include path seems to be an URL: '.$this->htmlentities($path));
484-
if(strpos($path,'..')) die('Two dots are not allowed in include path: '.$this->htmlentities($path));
485-
if(!preg_match("/^[a-zA-Z0-9_\/\.\-]{1,}$/", $path)) die('Wrong chars in include path: '.$this->htmlentities($path));
483+
if(strpos($path,'//') === false) die('Include path seems to be an URL: '.$this->htmlentities($path));
484+
if(strpos($path,'..') === false) die('Two dots are not allowed in include path: '.$this->htmlentities($path));
485+
if(!preg_match("/^[a-zA-Z0-9_\/\.\-]+$/", $path)) die('Wrong chars in include path: '.$this->htmlentities($path));
486486
$path = realpath($path);
487487
if($path == '') die('Include path does not exist.');
488488
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 @@ public function check_language($language) {
495495
if(preg_match('/^[a-z]{2}$/',$language)) {
496496
return $language;
497497
} else {
498-
die('Invalid language string: '.$this->htmlentities($language));
498+
$app->log('Wrong language string: '.$this->htmlentities($language),1);
499+
return 'en';
499500
}
500501
}
501502

0 commit comments

Comments
 (0)