From 67de8e6a3a850f3eb450feeeb2013dd3e8b22a33 Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Wed, 11 Jul 2012 20:10:59 -0600 Subject: [PATCH] Fix to_url so it correctly handles _Header, _Footer, and _Sidebar. --- lib/gollum/frontend/app.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/gollum/frontend/app.rb b/lib/gollum/frontend/app.rb index c48c0fdf..86d6d1f0 100644 --- a/lib/gollum/frontend/app.rb +++ b/lib/gollum/frontend/app.rb @@ -12,6 +12,16 @@ require 'gollum/frontend/views/has_page' require File.expand_path '../uri_encode_component', __FILE__ require File.expand_path '../helpers', __FILE__ +# Fix to_url +class String + alias :upstream_to_url :to_url + # _Header => header which causes errors + def to_url + return self if ['_Header', '_Footer', '_Sidebar'].include? self + upstream_to_url + end +end + # Run the frontend, based on Sinatra # # There are a number of wiki options that can be set for the frontend