gollum 2.4.6 → 2.4.7

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gollum might be problematic. Click here for more details.

@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
5
5
  s.required_ruby_version = ">= 1.8.7"
6
6
 
7
7
  s.name = 'gollum'
8
- s.version = '2.4.6'
9
- s.date = '2012-12-18'
8
+ s.version = '2.4.7'
9
+ s.date = '2012-12-20'
10
10
  s.rubyforge_project = 'gollum'
11
11
 
12
12
  s.summary = "A simple, Git-powered wiki."
@@ -28,7 +28,7 @@ require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
28
28
  $KCODE = 'U' if RUBY_VERSION[0,3] == '1.8'
29
29
 
30
30
  module Gollum
31
- VERSION = '2.4.6'
31
+ VERSION = '2.4.7'
32
32
 
33
33
  def self.assets_path
34
34
  ::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
@@ -85,6 +85,10 @@ module Gollum
85
85
  #
86
86
  # Returns nothing (modifies the Index in place).
87
87
  def add_to_index(dir, name, format, data, allow_same_ext = false)
88
+ # spaces must be dashes
89
+ dir.gsub!(' ', '-')
90
+ name.gsub!(' ', '-')
91
+
88
92
  path = @wiki.page_file_name(name, format)
89
93
 
90
94
  dir = '/' if dir.strip.empty?
@@ -181,7 +181,8 @@ module Precious
181
181
 
182
182
  page = wikip.page
183
183
  if page
184
- redirect to("/#{page.escaped_url_path}")
184
+ page_dir = settings.wiki_options[:page_file_dir].to_s
185
+ redirect to("/#{clean_url(::File.join(page_dir, page.escaped_url_path))}")
185
186
  else
186
187
  mustache :create
187
188
  end
@@ -191,16 +192,13 @@ module Precious
191
192
  name = params[:page].to_url
192
193
  path = sanitize_empty_params(params[:path]) || ''
193
194
  format = params[:format].intern
194
-
195
- # ensure pages are created in page_file_dir
196
- page_dir = settings.wiki_options[:page_file_dir].to_s
197
- path = clean_url(::File.join(page_dir, path)) unless path.start_with?(page_dir)
198
-
199
195
  wiki = wiki_new
200
196
 
201
197
  begin
202
198
  wiki.write_page(name, format, params[:content], commit_message, path)
203
- redirect to("/#{clean_url(::File.join(path,name))}")
199
+
200
+ page_dir = settings.wiki_options[:page_file_dir].to_s
201
+ redirect to("/#{clean_url(::File.join(page_dir, path, name))}")
204
202
  rescue Gollum::DuplicatePageError => e
205
203
  @message = "Duplicate page: #{e.message}"
206
204
  mustache :error
@@ -345,9 +343,6 @@ module Precious
345
343
  path = extract_path(fullpath) || '/'
346
344
  wiki = wiki_new
347
345
 
348
- page_dir = settings.wiki_options[:page_file_dir].to_s
349
- path = ::File.join(page_dir, path) unless path.start_with?(page_dir)
350
-
351
346
  if page = wiki.paged(name, path, exact = true)
352
347
  @page = page
353
348
  @name = name
@@ -420,7 +420,7 @@ module Gollum
420
420
  path = cname[0..slash]
421
421
  page = @wiki.paged(name, path)
422
422
  else
423
- page = @wiki.paged(cname, '/')
423
+ page = @wiki.paged(cname, '/') || @wiki.page(cname)
424
424
  end
425
425
 
426
426
  if page
@@ -287,6 +287,10 @@ module Gollum
287
287
  # Returns the String SHA1 of the newly written version, or the
288
288
  # Gollum::Committer instance if this is part of a batch update.
289
289
  def write_page(name, format, data, commit = {}, dir = '')
290
+ # spaces must be dashes
291
+ name.gsub!(' ', '-')
292
+ dir.gsub!(' ', '-')
293
+
290
294
  multi_commit = false
291
295
 
292
296
  committer = if obj = commit[:committer]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.6
4
+ version: 2.4.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-12-18 00:00:00.000000000 Z
13
+ date: 2012-12-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: grit