From baa904eaa889c4368c00e6005cf7520ec1dcb985 Mon Sep 17 00:00:00 2001 From: nohn Date: Mon, 9 May 2005 08:33:50 +0000 Subject: [PATCH] NO ONE should be able to upload dot-files --- include/admin/images.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/admin/images.inc.php b/include/admin/images.inc.php index fdedb81..b2a3c6c 100644 --- a/include/admin/images.inc.php +++ b/include/admin/images.inc.php @@ -125,7 +125,7 @@ switch ($serendipity['GET']['adminAction']) { $tindex = 1; } - if ($serendipity['serendipityUserlevel'] < USERLEVEL_ADMIN && (preg_match('@\.(php[34]?|[ps]html?)$@i', $tfile) || preg_match('@^\.@', $tfile)) { + if (preg_match('@^\.@', $tfile) || ($serendipity['serendipityUserlevel'] < USERLEVEL_ADMIN && (preg_match('@\.(php[34]?|[ps]html?)$@i', $tfile)))) { printf(ERROR_FILE_FORBIDDEN, $tfile); break; } @@ -188,7 +188,7 @@ switch ($serendipity['GET']['adminAction']) { continue; } - if ($serendipity['serendipityUserlevel'] < USERLEVEL_ADMIN && preg_match('@\.(php[34]?|[ps]html?)$@i', $tfile)) { + if (preg_match('@^\.@', $tfile) || ($serendipity['serendipityUserlevel'] < USERLEVEL_ADMIN && (preg_match('@\.(php[34]?|[ps]html?)$@i', $tfile)))) { printf(ERROR_FILE_FORBIDDEN, $tfile); echo '
'; continue; -- 2.39.5