Skip to content

Commit d7ec820

Browse files
committed
escape use of hyphen in slug regex
1 parent bf54b9b commit d7ec820

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/models/trough/document.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def set_slug(fix_for_extensions=false)
6060
else
6161
filename = file_filename.split('.')[0...-1].join('.')
6262
end
63-
escaped_name = filename ? filename.downcase.gsub(/[^0-9a-z-_. ]/, '').squish.gsub(' ', '-') : 'temporary'
63+
escaped_name = filename ? filename.downcase.gsub(/[^0-9a-z\-_. ]/, '').squish.gsub(' ', '-') : 'temporary'
6464
temp_slug = escaped_name.dup
6565
suffix = 1
6666
while Document.where(slug: temp_slug).present?

lib/trough/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Trough
2-
VERSION = "1.0.1"
2+
VERSION = "1.0.2"
33
end

0 commit comments

Comments
 (0)