From 7e622f8e302b23420ccd52ca07c176910bec85e1 Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Fri, 8 Feb 2008 08:27:05 +0000 Subject: [PATCH] Utilities::redirect: Changed output to be xhtml compliant, and added autofocus on the redirect link. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@269 44740490-163a-0410-bde0-09ae8108e29a --- lib/SimpleSAML/Utilities.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php index 938a06d47..fc1a9f030 100644 --- a/lib/SimpleSAML/Utilities.php +++ b/lib/SimpleSAML/Utilities.php @@ -403,9 +403,20 @@ class SimpleSAML_Utilities { header('Location: ' . $url, TRUE, $code); /* Show a minimal web page with a clickable link to the URL. */ - echo '<html><body><h1>Redirect</h1>You were redirected to: <a href="' . - htmlspecialchars($url) . '">' . htmlspecialchars($url) - . '</a></body></html>'; + echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; + echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"' . + ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' . "\n"; + echo '<html xmlns="http://www.w3.org/1999/xhtml">'; + echo '<head><title>Redirect</title></head>'; + echo '<body>'; + echo '<h1>Redirect</h1>'; + echo '<p>'; + echo 'You were redirected to: '; + echo '<a id="redirlink" href="' . htmlspecialchars($url) . '">' . htmlspecialchars($url) . '</a>'; + echo '<script type="text/javascript">document.getElementById("redirlink").focus();</script>'; + echo '</p>'; + echo '</body>'; + echo '</html>'; /* End script execution. */ exit; -- GitLab