From 9db425940987b2a45af9feecefa9419d81685320 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Sun, 17 Oct 2010 22:13:32 +0200 Subject: [PATCH] Introduce Adminer::headers method --- adminer/include/adminer.inc.php | 7 +++++++ adminer/include/design.inc.php | 2 +- changes.txt | 1 + editor/include/adminer.inc.php | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index d9692133..a9253eae 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -32,6 +32,13 @@ class Adminer { return DB; } + /** Headers to send before HTML output + * @return null + */ + function headers() { + header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox NoScript plugin + } + /** Print login form * @return null */ diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index 621ec5bc..445a7b24 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -9,7 +9,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") { global $LANG, $HTTPS, $adminer, $connection, $drivers; header("Content-Type: text/html; charset=utf-8"); - header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox NoScript plugin + $adminer->headers(); $title_all = $title . ($title2 != "" ? ": " . h($title2) : ""); $protocol = ($HTTPS ? "https" : "http"); ?> diff --git a/changes.txt b/changes.txt index ac845ee9..87894e2b 100644 --- a/changes.txt +++ b/changes.txt @@ -1,6 +1,7 @@ Adminer 3.0.1-dev: Send the form by Ctrl+Enter in all textareas Disable creating SQLite databases with extension other than db, sdb, sqlite +Ability to use Adminer in a frame through customization Catalan translation MS SQL 2005 compatibility PostgreSQL: connect if the eponymous database does not exist diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index e7c74760..8014e74c 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -26,6 +26,10 @@ class Adminer { ); } + function headers() { + header("X-Frame-Options: deny"); + } + function loginForm() { ?>