mirror of
https://github.com/vrana/adminer.git
synced 2025-08-09 08:06:59 +02:00
Utilize location.protocol
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
||||||
global $LANG, $HTTPS, $adminer, $connection, $drivers;
|
global $LANG, $adminer, $connection, $drivers;
|
||||||
header("Content-Type: text/html; charset=utf-8");
|
header("Content-Type: text/html; charset=utf-8");
|
||||||
$adminer->headers();
|
$adminer->headers();
|
||||||
$title_all = $title . ($title2 != "" ? ": " . h($title2) : "");
|
$title_all = $title . ($title2 != "" ? ": " . h($title2) : "");
|
||||||
@@ -15,7 +15,6 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
|||||||
if (is_ajax()) {
|
if (is_ajax()) {
|
||||||
header("X-AJAX-Title: " . rawurlencode($title_page));
|
header("X-AJAX-Title: " . rawurlencode($title_page));
|
||||||
} else {
|
} else {
|
||||||
$protocol = ($HTTPS ? "https" : "http");
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
||||||
<html lang="<?php echo $LANG; ?>" dir="<?php echo lang('ltr'); ?>">
|
<html lang="<?php echo $LANG; ?>" dir="<?php echo lang('ltr'); ?>">
|
||||||
@@ -29,7 +28,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
|||||||
<link rel="stylesheet" type="text/css" href="adminer.css">
|
<link rel="stylesheet" type="text/css" href="adminer.css">
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<body class="<?php echo lang('ltr'); ?>" onclick="return bodyClick(event, '<?php echo js_escape(DB); ?>', '<?php echo js_escape($_GET["ns"]); ?>');" onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>', '<?php echo $protocol; ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
|
<body class="<?php echo lang('ltr'); ?>" onclick="return bodyClick(event, '<?php echo js_escape(DB); ?>', '<?php echo js_escape($_GET["ns"]); ?>');" onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
|
||||||
<script type="text/javascript" src="../adminer/static/functions.js"></script>
|
<script type="text/javascript" src="../adminer/static/functions.js"></script>
|
||||||
<script type="text/javascript" src="static/editing.js"></script>
|
<script type="text/javascript" src="static/editing.js"></script>
|
||||||
|
|
||||||
|
@@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
/** Load syntax highlighting
|
/** Load syntax highlighting
|
||||||
* @param string first three characters of database system version
|
* @param string first three characters of database system version
|
||||||
* @param string 'http' or 'https' - used after compilation
|
|
||||||
*/
|
*/
|
||||||
function bodyLoad(version, protocol) {
|
function bodyLoad(version) {
|
||||||
var jushRoot = '../externals/jush/';
|
var jushRoot = '../externals/jush/';
|
||||||
var script = document.createElement('script');
|
var script = document.createElement('script');
|
||||||
script.src = jushRoot + 'jush.js';
|
script.src = jushRoot + 'jush.js';
|
||||||
|
@@ -23,12 +23,11 @@ function cookie(assign, days) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Verify current Adminer version
|
/** Verify current Adminer version
|
||||||
* @param string 'http' or 'https'
|
|
||||||
*/
|
*/
|
||||||
function verifyVersion(protocol) {
|
function verifyVersion() {
|
||||||
cookie('adminer_version=0', 1);
|
cookie('adminer_version=0', 1);
|
||||||
var script = document.createElement('script');
|
var script = document.createElement('script');
|
||||||
script.src = protocol + '://www.adminer.org/version.php';
|
script.src = location.protocol + '//www.adminer.org/version.php';
|
||||||
document.body.appendChild(script);
|
document.body.appendChild(script);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -265,7 +265,7 @@ foreach (array("adminer", "editor") as $project) {
|
|||||||
$file = preg_replace('~\\.\\./adminer/static/(loader\\.gif)~', "'+location.pathname+'?file=\\1&version=$VERSION", $file);
|
$file = preg_replace('~\\.\\./adminer/static/(loader\\.gif)~', "'+location.pathname+'?file=\\1&version=$VERSION", $file);
|
||||||
$file = preg_replace('~\\.\\./adminer/static/(default\\.css|functions\\.js|favicon\\.ico)~', '<?php echo ' . $replace . '"; ?>', $file);
|
$file = preg_replace('~\\.\\./adminer/static/(default\\.css|functions\\.js|favicon\\.ico)~', '<?php echo ' . $replace . '"; ?>', $file);
|
||||||
$file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . ' . $replace, $file);
|
$file = preg_replace('~\\.\\./adminer/static/([^\'"]*)~', '" . ' . $replace, $file);
|
||||||
$file = str_replace("'../externals/jush/'", "protocol + '://www.adminer.org/static/'", $file);
|
$file = str_replace("'../externals/jush/'", "location.protocol + '//www.adminer.org/static/'", $file);
|
||||||
$file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);
|
$file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);
|
||||||
$file = php_shrink($file);
|
$file = php_shrink($file);
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
// Editor specific functions
|
// Editor specific functions
|
||||||
|
|
||||||
function bodyLoad(version, protocol) {
|
function bodyLoad(version) {
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user