Fix serendipity_killPath().

Cherry-picked from master.

Signed-off-by: Thomas Hochstein <thh@inter.net>
This commit is contained in:
surrim 2020-03-16 23:51:17 +01:00 committed by Thomas Hochstein
parent d462580606
commit 67aea1b623
2 changed files with 4 additions and 0 deletions

View File

@ -1,6 +1,9 @@
Version 2.3.3-beta1 () Version 2.3.3-beta1 ()
------------------------------------------------------------------------ ------------------------------------------------------------------------
* Fix serendipity_killPath().
Thanks to @surrim!
* Don't allow requesting an archive page that doesn't exist. * Don't allow requesting an archive page that doesn't exist.
Thanks to @lotharsm! Thanks to @lotharsm!

View File

@ -1839,6 +1839,7 @@ function serendipity_killPath($basedir, $directory = '', $forceDelete = false) {
static $serious = true; static $serious = true;
if ($handle = @opendir($basedir . $directory)) { if ($handle = @opendir($basedir . $directory)) {
$filestack = [];
while (false !== ($file = @readdir($handle))) { while (false !== ($file = @readdir($handle))) {
if ($file != '.' && $file != '..') { if ($file != '.' && $file != '..') {
if (is_dir($basedir . $directory . $file)) { if (is_dir($basedir . $directory . $file)) {