Commit 942443cc authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Add better regex to check the pathname of the local NS file and spit

proper error.
parent fe350a58
......@@ -621,6 +621,16 @@ if ($speclocal) {
# Do not allow anything outside of special dirs. I do not think there
# is a security worry, but good to enforce it anyway.
#
if (!preg_match("/^([-\@\w\.\/]+)$/", $exp_localnsfile)) {
if (isset($syntax)) {
echo "<h3 style='color: #f00'>Error: \n".
"Pathname includes illegal characters!</h3>\n";
die("");
}
else {
RESPIT("NS File", "Pathname includes illegal characters");
}
}
if (! ereg("^$TBPROJ_DIR/.*" ,$exp_localnsfile) &&
! ereg("^$TBUSER_DIR/.*" ,$exp_localnsfile) &&
! ereg("^$TBGROUP_DIR/.*" ,$exp_localnsfile)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment