mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUG Fix encoding of JS redirection script
This commit is contained in:
parent
ff9d40a60d
commit
f8e3bbe3ae
@ -213,12 +213,14 @@ class SS_HTTPResponse {
|
||||
}
|
||||
|
||||
if(in_array($this->statusCode, self::$redirect_codes) && headers_sent($file, $line)) {
|
||||
$url = Convert::raw2htmlatt($this->headers['Location']);
|
||||
$url = (string)$this->headers['Location'];
|
||||
$urlATT = Convert::raw2htmlatt($url);
|
||||
$urlJS = Convert::raw2js($url);
|
||||
echo
|
||||
"<p>Redirecting to <a href=\"$url\" title=\"Click this link if your browser does not redirect you\">"
|
||||
. "$url... (output started on $file, line $line)</a></p>
|
||||
<meta http-equiv=\"refresh\" content=\"1; url=$url\" />
|
||||
<script type=\"text/javascript\">setTimeout('window.location.href = \"$url\"', 50);</script>";
|
||||
"<p>Redirecting to <a href=\"$urlATT\" title=\"Click this link if your browser does not redirect you\">"
|
||||
. "$urlATT... (output started on $file, line $line)</a></p>
|
||||
<meta http-equiv=\"refresh\" content=\"1; url=$urlATT\" />
|
||||
<script type=\"text/javascript\">setTimeout(function(){ window.location.href = \"$urlJS\"; }, 50);</script>";
|
||||
} else {
|
||||
$line = $file = null;
|
||||
if(!headers_sent($file, $line)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user