Fix spaces in dir #611

This commit is contained in:
bootstraponline
2012-12-20 17:45:39 -07:00
parent ddf4378dfe
commit bb32339ab4
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -85,6 +85,10 @@ module Gollum
#
# Returns nothing (modifies the Index in place).
def add_to_index(dir, name, format, data, allow_same_ext = false)
# spaces must be dashes
dir.gsub!(' ', '-')
name.gsub!(' ', '-')
path = @wiki.page_file_name(name, format)
dir = '/' if dir.strip.empty?
+4
View File
@@ -287,6 +287,10 @@ module Gollum
# Returns the String SHA1 of the newly written version, or the
# Gollum::Committer instance if this is part of a batch update.
def write_page(name, format, data, commit = {}, dir = '')
# spaces must be dashes
name.gsub!(' ', '-')
dir.gsub!(' ', '-')
multi_commit = false
committer = if obj = commit[:committer]