diff --git a/core/05-functions.php b/core/05-functions.php index 746ec17..429995a 100644 --- a/core/05-functions.php +++ b/core/05-functions.php @@ -289,6 +289,8 @@ function makepathsafe($string) $string = preg_replace("/\.+/", ".", $string); // Don't allow slashes at the beginning $string = ltrim($string, "\\/"); + // Don't allow dots on their own + $string = preg_replace(["/^\.\\/|\\/\.$/", "/\\/\.\\//"], ["", "/"], $string); return $string; }