Escape more regex characters, closes #3041

This commit is contained in:
José Valim 2025-08-06 19:03:25 +02:00
parent 5ce550fd5f
commit acccc9e837

View file

@ -221,7 +221,7 @@ defmodule LivebookWeb.SessionHelpers do
@spec sanitize_file_entry_name(String.t()) :: String.t() | nil
def sanitize_file_entry_name(client_name) do
client_name
|> String.replace(~r/[^\s\w-.]/u, "")
|> String.replace(~r/[^\s\w\-\.]/u, "")
|> String.trim()
|> String.replace(~r/\s+/u, "_")
|> case do