File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments