Skip to content
Browse files

BUG Fix encoding of JS redirection script

  • Loading branch information...
1 parent ff9d40a commit f8e3bbe3ae3f29f22d85abb73cea033659511168 @tractorcow tractorcow committed Mar 27, 2014
Showing with 7 additions and 5 deletions.
  1. +7 −5 control/HTTPResponse.php
View
12 control/HTTPResponse.php
@@ -213,12 +213,14 @@ public function output() {
}
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)) {

0 comments on commit f8e3bbe

Please sign in to comment.
Something went wrong with that request. Please try again.