Commit 73fe5ec9 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Minor change to regex; allow .txt too.

parent ffbc29d7
......@@ -30,7 +30,7 @@ if (!$printable) {
#
# Need to sanity check the path! Allow only [word].{html,txt} files
#
if (!preg_match("/^[\w-]+\.(html|txt)$/", $docname)) {
if (!preg_match("/^[-\w]+\.(html|txt)$/", $docname)) {
USERERROR("Illegal document name: $docname!", 1);
}
......
......@@ -28,7 +28,7 @@ if (!$printable) {
#
# Need to sanity check the path! Allow only [word].html files
#
if (!preg_match("/^[\w-]+\.html$/", $docname)) {
if (!preg_match("/^[-\w]+\.(html|txt)$/", $docname)) {
USERERROR("Illegal document name: $docname!", 1);
}
......
......@@ -30,7 +30,7 @@ if (!$printable) {
#
# Need to sanity check the path! Allow only [word].html files
#
if (!preg_match("/^[\w-]+\.html$/", $docname)) {
if (!preg_match("/^[-\w]+\.(html|txt)$/", $docname)) {
USERERROR("Illegal document name: $docname!", 1);
}
......
Supports Markdown
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