Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libraries/core.lib.php24
-rw-r--r--templates/header_location.phtml21
-rw-r--r--test/libraries/core/PMA_headerLocation_test.php31
3 files changed, 36 insertions, 40 deletions
diff --git a/libraries/core.lib.php b/libraries/core.lib.php
index a1f44b3424..f448e18880 100644
--- a/libraries/core.lib.php
+++ b/libraries/core.lib.php
@@ -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;
}
diff --git a/templates/header_location.phtml b/templates/header_location.phtml
new file mode 100644
index 0000000000..957441727f
--- /dev/null
+++ b/templates/header_location.phtml
@@ -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> \ No newline at end of file
diff --git a/test/libraries/core/PMA_headerLocation_test.php b/test/libraries/core/PMA_headerLocation_test.php
index 012ba6174b..063c51243e 100644
--- a/test/libraries/core/PMA_headerLocation_test.php
+++ b/test/libraries/core/PMA_headerLocation_test.php
@@ -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);