diff options
author | Ted Trask <ttrask01@yahoo.com> | 2009-03-28 14:51:56 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2009-03-28 14:51:56 +0000 |
commit | 1f42724eca5fea69afce084da898d0d1466599fc (patch) | |
tree | 90fe845c5f10984f3b5baab2878fad74c46f62a8 | |
parent | 520ba28e7a281a39adc916687cb5428846f48421 (diff) | |
download | acf-core-1f42724eca5fea69afce084da898d0d1466599fc.tar.bz2 acf-core-1f42724eca5fea69afce084da898d0d1466599fc.tar.xz |
Modified redirect to referrer to ignore if REFERRER is empty.
-rw-r--r-- | app/acf_www-controller.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/acf_www-controller.lua b/app/acf_www-controller.lua index fb12a6e..de50e2c 100644 --- a/app/acf_www-controller.lua +++ b/app/acf_www-controller.lua @@ -477,9 +477,11 @@ redirect_to_referrer = function(self, result) if result and not self.conf.component then -- If we have a result, then we did something, so we might have to redirect if not ENV.HTTP_REFERER then - -- If no referrer, we have a problem. Can't let it go through, because action - -- might not have view. So redirect to default action for this controller. - self:redirect() + -- If no referrer, we have a potential problem. + if not find_view(self.conf.appdir, self.conf.prefix, self.conf.controller, self.conf.action, self.conf.viewtype or "html") then + -- Action does not have view, so redirect to default action for this controller. + self:redirect() + end else local prefix, controller, action = self.parse_path_info(ENV.HTTP_REFERER:gsub("%?.*", "")) if controller ~= self.conf.controller or action ~= self.conf.action then |