mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-04 12:04:20 +08:00
Escape - and . in regex character class, closes #3040
This commit is contained in:
parent
036681ecb3
commit
5ce550fd5f
1 changed files with 1 additions and 1 deletions
|
@ -953,7 +953,7 @@ defmodule Livebook.Notebook do
|
|||
@spec validate_file_entry_name(Ecto.Changeset.t(), atom()) :: Ecto.Changeset.t()
|
||||
def validate_file_entry_name(changeset, field) do
|
||||
changeset
|
||||
|> Ecto.Changeset.validate_format(field, ~r/^[\w-.]+$/,
|
||||
|> Ecto.Changeset.validate_format(field, ~r/^[\w\-\.]+$/,
|
||||
message: "should contain only alphanumeric characters, dash, underscore and dot"
|
||||
)
|
||||
|> Ecto.Changeset.validate_format(field, ~r/\.\w+$/, message: "should end with an extension")
|
||||
|
|
Loading…
Add table
Reference in a new issue