diff --git a/main/inc/lib/api.lib.php b/main/inc/lib/api.lib.php index 448ae65f34..dda5ebe7c0 100644 --- a/main/inc/lib/api.lib.php +++ b/main/inc/lib/api.lib.php @@ -6670,6 +6670,10 @@ function api_replace_dangerous_char($filename, $treat_spaces_as_hyphens = true) $treat_spaces_as_hyphens ); + // Replace multiple dots at the end. + $regex = "/\.+$/"; + $url = preg_replace($regex, '', $url); + return $url; }