mirror of
https://github.com/neocities/neocities.git
synced 2025-08-03 08:11:56 +02:00
more fixes for file path
This commit is contained in:
parent
208950df55
commit
48cef121a1
3 changed files with 11 additions and 6 deletions
|
@ -1428,6 +1428,10 @@ class Site < Sequel::Model
|
|||
'https'
|
||||
end
|
||||
|
||||
def self.escape_path(val)
|
||||
Rack::Utils.escape_path(val).gsub('?', '%3F')
|
||||
end
|
||||
|
||||
def uri(path=nil)
|
||||
uri = "#{default_schema}://#{host}"
|
||||
|
||||
|
@ -1437,7 +1441,7 @@ class Site < Sequel::Model
|
|||
path = path.sub(%r{^/}, '').sub(%r{/index\.html$}, '/').sub(/\.html$/, '')
|
||||
|
||||
unless path.empty?
|
||||
escaped_path = Rack::Utils.escape_path(path).gsub('?', '%3F')
|
||||
escaped_path = self.class.escape_path path
|
||||
uri += "/#{escaped_path}"
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue