IPv6-compatible fix for latest Philip Taylor Phun
This is better than Revision 228.
This commit is contained in:
parent
d46798dd08
commit
35257b5fae
|
@ -3,6 +3,7 @@ require 'maruku'
|
||||||
require 'parsedate'
|
require 'parsedate'
|
||||||
require 'zip/zip'
|
require 'zip/zip'
|
||||||
require 'sanitize'
|
require 'sanitize'
|
||||||
|
require 'resolv'
|
||||||
|
|
||||||
class WikiController < ApplicationController
|
class WikiController < ApplicationController
|
||||||
|
|
||||||
|
@ -412,7 +413,7 @@ class WikiController < ApplicationController
|
||||||
def remote_ip
|
def remote_ip
|
||||||
ip = request.remote_ip
|
ip = request.remote_ip
|
||||||
logger.info(ip)
|
logger.info(ip)
|
||||||
ip.gsub!(/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/, '\1')
|
ip.gsub!(Regexp.union(Resolv::IPv4::Regex, Resolv::IPv6::Regex), '\0') || 'bogus address'
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_atom(hide_description = false, limit = 15)
|
def render_atom(hide_description = false, limit = 15)
|
||||||
|
|
Loading…
Reference in a new issue