]> git.joonet.de Git - adminer.git/commitdiff
Easier sending of default headers (customization)
authorJakub Vrana <jakub@vrana.cz>
Tue, 31 May 2011 05:48:10 +0000 (07:48 +0200)
committerJakub Vrana <jakub@vrana.cz>
Tue, 31 May 2011 06:01:48 +0000 (08:01 +0200)
adminer/include/adminer.inc.php
adminer/include/design.inc.php
changes.txt
editor/include/adminer.inc.php

index c29546ffbddb9c0ca94d94fd9724f57a4880dce2..639306cf3ac98961875feb31da9e3387c75d85b1 100644 (file)
@@ -35,11 +35,10 @@ class Adminer {
        }
        
        /** Headers to send before HTML output
-       * @return null
+       * @return bool true to send security headers
        */
        function headers() {
-               header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox 3.6.9
-               header("X-XSS-Protection: 0"); // prevents introducing XSS in IE8 by removing safe parts of the page
+               return true;
        }
        
        /** Print HTML code inside <head>
index 8298d1fe7dbe8c70bc5b319496edd677a32dbbf0..f8c66f20c9a1fb105bf394997adaa2a42f07e153 100644 (file)
@@ -9,7 +9,10 @@
 function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
        global $LANG, $adminer, $connection, $drivers;
        header("Content-Type: text/html; charset=utf-8");
-       $adminer->headers();
+       if ($adminer->headers()) {
+               header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox 3.6.9
+               header("X-XSS-Protection: 0"); // prevents introducing XSS in IE8 by removing safe parts of the page
+       }
        $title_all = $title . ($title2 != "" ? ": " . h($title2) : "");
        $title_page = strip_tags($title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name());
        if (is_ajax()) {
index 8dc7681c250d1af3d4b83fe540c94fe180c86d47..5801ba42953a6e22bbffde0bf563b0bb8fc3c03b 100644 (file)
@@ -8,6 +8,7 @@ Autocomplete for big foreign keys (Editor)
 Display name of the referenced record in PostgreSQL (Editor)
 Customizable favicon (customization)
 Method name can return a link (customization)
+Easier sending of default headers (customization)
 
 Adminer 3.2.2 (released 2011-03-28):
 Fix AJAX history after reload
index 2692c8925d4392bc41c42a74b1974d9807b00783..a88b53cf2ecc8cc920d1f03bfdb9e02c86e482f1 100644 (file)
@@ -27,8 +27,7 @@ class Adminer {
        }
        
        function headers() {
-               header("X-Frame-Options: deny");
-               header("X-XSS-Protection: 0");
+               return true;
        }
        
        function head() {