lib/media_wiki/utils.rb in mediawiki-gateway-0.3.8 vs lib/media_wiki/utils.rb in mediawiki-gateway-0.4.1
- old
+ new
@@ -1,8 +1,6 @@
module MediaWiki
- require 'activesupport'
-
class << self
# Extract base name. If there are no subpages, return page name.
#
# Examples:
@@ -47,10 +45,10 @@
# Convert a Wiki page name ("Getting there & away") to URI-safe format ("Getting_there_%26_away"),
# taking care not to mangle slashes or colons
# [wiki] Page name string in Wiki format
def wiki_to_uri(wiki)
- wiki.to_s.split('/').map {|chunk| CGI.escape(chunk.tr(' ', '_')) }.join('/').gsub('%3A', ':') if wiki
+ wiki.to_s.split('/').map {|chunk| CGI.escape(CGI.unescape(chunk).tr(' ', '_')) }.join('/').gsub('%3A', ':') if wiki
end
# Return current version of MediaWiki::Gateway
def version
MediaWiki::VERSION