Skip to content

Commit

Permalink
Merge pull request #11 from Yoomee/bugs/slug-regex
Browse files Browse the repository at this point in the history
escape use of hyphen in slug regex
  • Loading branch information
ArayB authored Aug 31, 2016
2 parents bf54b9b + d7ec820 commit f46b2b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/trough/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def set_slug(fix_for_extensions=false)
else
filename = file_filename.split('.')[0...-1].join('.')
end
escaped_name = filename ? filename.downcase.gsub(/[^0-9a-z-_. ]/, '').squish.gsub(' ', '-') : 'temporary'
escaped_name = filename ? filename.downcase.gsub(/[^0-9a-z\-_. ]/, '').squish.gsub(' ', '-') : 'temporary'
temp_slug = escaped_name.dup
suffix = 1
while Document.where(slug: temp_slug).present?
Expand Down
2 changes: 1 addition & 1 deletion lib/trough/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Trough
VERSION = "1.0.1"
VERSION = "1.0.2"
end

0 comments on commit f46b2b5

Please sign in to comment.