Use HTTP protocol if possible - adminer.org certificate is missing in Opera
This commit is contained in:
parent
c1f8382515
commit
4c47d354e7
|
@ -11,6 +11,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
||||||
header("Content-Type: text/html; charset=utf-8");
|
header("Content-Type: text/html; charset=utf-8");
|
||||||
header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox NoScript plugin
|
header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox NoScript plugin
|
||||||
$title_all = $title . ($title2 != "" ? ": " . h($title2) : "");
|
$title_all = $title . ($title2 != "" ? ": " . h($title2) : "");
|
||||||
|
$protocol = ($_SERVER["HTTPS"] && strcasecmp($_SERVER["HTTPS"], "off") ? "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; ?>">
|
<html lang="<?php echo $LANG; ?>">
|
||||||
|
@ -24,7 +25,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 onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion();"); ?>">
|
<body onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>', '<?php echo $protocol; ?>');<?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,8 +2,9 @@
|
||||||
|
|
||||||
/** 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) {
|
function bodyLoad(version, protocol) {
|
||||||
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,11 +23,12 @@ function cookie(assign, days, params) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Verify current Adminer version
|
/** Verify current Adminer version
|
||||||
|
* @param string 'http' or 'https'
|
||||||
*/
|
*/
|
||||||
function verifyVersion() {
|
function verifyVersion(protocol) {
|
||||||
cookie('adminer_version=0', 1);
|
cookie('adminer_version=0', 1);
|
||||||
var script = document.createElement('script');
|
var script = document.createElement('script');
|
||||||
script.src = 'https://www.adminer.org/version.php';
|
script.src = protocol + '://www.adminer.org/version.php';
|
||||||
document.body.appendChild(script);
|
document.body.appendChild(script);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -244,7 +244,7 @@ foreach (array("adminer", "editor") as $project) {
|
||||||
$replace = 'h(preg_replace("~\\\\\\\\?.*~", "", $_SERVER["REQUEST_URI"])) . "?file=\\1&version=' . $VERSION;
|
$replace = 'h(preg_replace("~\\\\\\\\?.*~", "", $_SERVER["REQUEST_URI"])) . "?file=\\1&version=' . $VERSION;
|
||||||
$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/", "https://www.adminer.org/static/", $file);
|
$file = str_replace("'../externals/jush/'", "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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue