Ticket #49: Factfinder: "Finish" doesn't redirect to "thank you"

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@46044 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Normann Lou 2007-11-30 01:24:02 +00:00
parent f9dc7a81d7
commit 2ccd4c06ee
2 changed files with 5 additions and 1 deletions

View File

@ -422,6 +422,10 @@ class Controller extends ViewableData {
* Handle redirection
*/
function redirect($url) {
if($this->response->getHeader('Location')) {
user_error("Already directed to " . $this->response->getHeader('Location') . "; now trying to direct to $url", E_USER_ERROR);
}
// Attach site-root to relative links, if they have a slash in them
if($url == "" || $url[0] == '?' || (substr($url,0,4) != "http" && $url[0] != "/" && strpos($url,'/') !== false)){
$url = Director::baseURL() . $url;

View File

@ -240,7 +240,7 @@ class Director {
* @return string If redirect() has been called, it will return the URL redirected to. Otherwise, it will return null;
*/
static function redirected_to() {
Controller::curr()->redirectedTo();
return Controller::curr()->redirectedTo();
}
/*