Merge branch 'master' of https://github.com/phpmyadmin/phpmyadmin
This commit is contained in:
commit
ec7fc147b2
@ -590,26 +590,10 @@ function PMA_sendHeaderLocation($uri, $use_refresh = false)
|
||||
include_once './libraries/js_escape.lib.php';
|
||||
PMA_Response::getInstance()->disable();
|
||||
|
||||
echo '<html><head><title>- - -</title>' . "\n";
|
||||
echo '<meta http-equiv="expires" content="0">' . "\n";
|
||||
echo '<meta http-equiv="Pragma" content="no-cache">' . "\n";
|
||||
echo '<meta http-equiv="Cache-Control" content="no-cache">' . "\n";
|
||||
echo '<meta http-equiv="Refresh" content="0;url='
|
||||
. htmlspecialchars($uri) . '">' . "\n";
|
||||
echo '<script type="text/javascript">' . "\n";
|
||||
echo '//<![CDATA[' . "\n";
|
||||
echo 'setTimeout("window.location = unescape(\'"'
|
||||
. PMA_escapeJsString($uri) . '"\')", 2000);' . "\n";
|
||||
echo '//]]>' . "\n";
|
||||
echo '</script>' . "\n";
|
||||
echo '</head>' . "\n";
|
||||
echo '<body>' . "\n";
|
||||
echo '<script type="text/javascript">' . "\n";
|
||||
echo '//<![CDATA[' . "\n";
|
||||
echo 'document.write(\'<p><a href="' . htmlspecialchars($uri) . '">'
|
||||
. __('Go') . '</a></p>\');' . "\n";
|
||||
echo '//]]>' . "\n";
|
||||
echo '</script></body></html>' . "\n";
|
||||
include_once './libraries/Template.class.php';
|
||||
|
||||
echo PMA\Template::get('header_location')
|
||||
->render(array('uri' => $uri));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
21
templates/header_location.phtml
Normal file
21
templates/header_location.phtml
Normal file
@ -0,0 +1,21 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>- - -</title>
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Cache-Control" content="no-cache">
|
||||
<meta http-equiv="Refresh" content="0;url=<?php echo htmlspecialchars($uri) ?>">
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
setTimeout("window.location = unescape('<?php echo PMA_escapeJsString($uri) ?>')", 2000);
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
document.write('<p><a href="<?php echo htmlspecialchars($uri) ?>"><?php echo __('Go') ?></a></p>');
|
||||
//]]>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -257,26 +257,17 @@ class PMA_HeaderLocation_Test extends PHPUnit_Framework_TestCase
|
||||
$testUri_html = htmlspecialchars($testUri);
|
||||
$testUri_js = PMA_escapeJsString($testUri);
|
||||
|
||||
$header = "<html><head><title>- - -</title>\n" .
|
||||
"<meta http-equiv=\"expires\" content=\"0\">\n" .
|
||||
"<meta http-equiv=\"Pragma\" content=\"no-cache\">\n" .
|
||||
"<meta http-equiv=\"Cache-Control\" content=\"no-cache\">\n" .
|
||||
"<meta http-equiv=\"Refresh\" content=\"0;url=" . $testUri_html
|
||||
. "\">\n" .
|
||||
"<script type=\"text/javascript\">\n" .
|
||||
"//<![CDATA[\n" .
|
||||
"setTimeout(\"window.location = unescape('\"" . $testUri_js
|
||||
. "\"')\", 2000);\n" .
|
||||
"//]]>\n" .
|
||||
"</script>\n" .
|
||||
"</head>\n" .
|
||||
"<body>\n" .
|
||||
"<script type=\"text/javascript\">\n" .
|
||||
"//<![CDATA[\n" .
|
||||
"document.write('<p><a href=\"" . $testUri_html . "\">"
|
||||
. __('Go') . "</a></p>');\n" .
|
||||
"//]]>\n" .
|
||||
"</script></body></html>\n";
|
||||
$header = "<html><head><title>- - -</title>
|
||||
<meta http-equiv=\"expires\" content=\"0\">"
|
||||
. "<meta http-equiv=\"Pragma\" content=\"no-cache\">"
|
||||
. "<meta http-equiv=\"Cache-Control\" content=\"no-cache\">"
|
||||
. "<meta http-equiv=\"Refresh\" content=\"0;url=" . $testUri_html . "\">"
|
||||
. "<script type=\"text/javascript\">//<![CDATA[
|
||||
setTimeout(\"window.location = unescape('" . $testUri_js . "')\", 2000);
|
||||
//]]></script></head>
|
||||
<body><script type=\"text/javascript\">//<![CDATA[
|
||||
document.write('<p><a href=\"" . $testUri_html . "\">" . __('Go') . "</a></p>');
|
||||
//]]></script></body></html>";
|
||||
|
||||
$this->expectOutputString($header);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user