diff options
author | Ted Trask <ttrask01@yahoo.com> | 2010-01-13 16:09:17 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2010-01-13 16:09:17 +0000 |
commit | fbf9492b39641f0eef99c66b728c5d37e9bed932 (patch) | |
tree | 669446b204e23695e0c3afe4053bc68835bd79f4 /app | |
parent | b264e1673bee009cb5d67c9c4e6bf684dcc285f8 (diff) | |
download | acf-core-fbf9492b39641f0eef99c66b728c5d37e9bed932.tar.bz2 acf-core-fbf9492b39641f0eef99c66b728c5d37e9bed932.tar.xz |
Fixed redirect bug caused by escape in HTTP_REFERER.
Diffstat (limited to 'app')
-rw-r--r-- | app/acf_www-controller.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/acf_www-controller.lua b/app/acf_www-controller.lua index fdabc0b..9bdf798 100644 --- a/app/acf_www-controller.lua +++ b/app/acf_www-controller.lua @@ -526,7 +526,9 @@ redirect_to_referrer = function(self, result) self:redirect() end else - local prefix, controller, action = self.parse_path_info(ENV.HTTP_REFERER:gsub("%?.*", "")) + local p = ENV.HTTP_REFERER:gsub("%?.*", ""):gsub("%%(%x%x)", + function(h) return string.char(tonumber(h, 16)) end ) + local prefix, controller, action = self.parse_path_info(p) if prefix ~= self.conf.prefix or controller ~= self.conf.controller or action ~= self.conf.action then self.sessiondata[self.conf.action.."result"] = result error({type="redir_to_referrer"}) |