Skip to content

Instantly share code, notes, and snippets.

@jbroadway
Created January 7, 2013 16:52
Show Gist options
  • Save jbroadway/4476498 to your computer and use it in GitHub Desktop.
Save jbroadway/4476498 to your computer and use it in GitHub Desktop.
Potential fix for redirect causing emails to fail.
diff --git a/handlers/index.php b/handlers/index.php
index f3d44b3..933175c 100644
--- a/handlers/index.php
+++ b/handlers/index.php
@@ -51,6 +51,10 @@ if ($f->submit ()) {
}
}
+ // if there's a redirect, we wait to exit after
+ // all actions have been performed.
+ $has_redirect = false;
+
foreach ($f->actions as $action) {
// handle action
switch ($action->type) {
@@ -86,11 +90,16 @@ if ($f->submit ()) {
);
break;
case 'redirect':
- $this->redirect ($action->url);
+ $this->redirect ($action->url, false);
+ $has_redirect = true;
break;
}
}
+ if ($has_redirect) {
+ $this->quit ();
+ }
+
if (! $this->internal) {
$page->title = $f->response_title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment