protection against cross-frame scripting
This commit is contained in:
@@ -13,6 +13,27 @@ if (! defined('PHPMYADMIN')) {
|
||||
*/
|
||||
require_once './libraries/common.inc.php';
|
||||
|
||||
|
||||
// Cross-framing protection
|
||||
if ( false === $GLOBALS['cfg']['AllowThirdPartyFraming']) {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
try {
|
||||
// can't access this if on a different domain
|
||||
var topdomain = top.document.domain;
|
||||
// double-check just for sure
|
||||
if (topdomain != self.document.domain) {
|
||||
alert("Redirecting...");
|
||||
top.location.replace(self.document.URL.substring(0, self.document.URL.lastIndexOf("/")+1));
|
||||
}
|
||||
}
|
||||
catch(e) {
|
||||
alert("Redirecting... (error: " + e);
|
||||
top.location.replace(self.document.URL.substring(0, self.document.URL.lastIndexOf("/")+1));
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
// generate title
|
||||
$title = str_replace(
|
||||
array(
|
||||
|
Reference in New Issue
Block a user