BUGFIX Fixed double pragma after referer redirection on forms with Form->httpSubmission() (fixes #5509, thanks ktauber) (from r103936)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112325 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-10-14 23:51:55 +00:00
parent d25916b810
commit d2c096119c

View File

@ -280,7 +280,11 @@ class Form extends RequestHandler {
} else {
if($this->getRedirectToFormOnValidationError()) {
if($pageURL = $request->getHeader('Referer')) {
return Director::redirect($pageURL . '#' . $this->FormName());
if(Director::is_site_url($pageURL)) {
// Remove existing pragmas
$pageURL = preg_replace('/(#.*)/', '', $pageURL);
return Director::redirect($pageURL . '#' . $this->FormName());
}
}
}
return Director::redirectBack();