1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-29 17:19:52 +02:00

Avoid showing version on login page (and css/js version)

Thanks to MisterDuval (https://github.com/adminerevo/adminerevo/pull/180)
This commit is contained in:
Peter Knut
2024-08-17 00:47:23 +02:00
parent 949b39b191
commit 47ccfa2a2e
3 changed files with 11 additions and 5 deletions

View File

@@ -953,8 +953,11 @@ class Adminer {
global $VERSION, $jush, $drivers, $connection; global $VERSION, $jush, $drivers, $connection;
?> ?>
<h1> <h1>
<?php echo $this->name(); ?> <span class="version"><?php echo $VERSION; ?></span> <?php echo $this->name(); ?>
<a href="https://www.adminer.org/#download"<?php echo target_blank(); ?> id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?></a> <?php if ($missing != "auth"): ?>
<span class="version"><?php echo $VERSION; ?></span>
<a href="https://www.adminer.org/#download"<?php echo target_blank(); ?> id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?></a>
<?php endif; ?>
</h1> </h1>
<?php <?php
if ($missing == "auth") { if ($missing == "auth") {

View File

@@ -443,7 +443,7 @@ $file = str_replace('<?php echo script_src("static/editing.js"); ?>' . "\n", "",
$file = preg_replace('~\s+echo script_src\("\.\./externals/jush/modules/jush-(textarea|txt|js|\$jush)\.js"\);~', '', $file); $file = preg_replace('~\s+echo script_src\("\.\./externals/jush/modules/jush-(textarea|txt|js|\$jush)\.js"\);~', '', $file);
$file = str_replace('<link rel="stylesheet" type="text/css" href="../vendor/vrana/jush/jush.css">' . "\n", "", $file); $file = str_replace('<link rel="stylesheet" type="text/css" href="../vendor/vrana/jush/jush.css">' . "\n", "", $file);
$file = preg_replace_callback("~compile_file\\('([^']+)'(?:, '([^']*)')?\\)~", 'compile_file', $file); // integrate static files $file = preg_replace_callback("~compile_file\\('([^']+)'(?:, '([^']*)')?\\)~", 'compile_file', $file); // integrate static files
$replace = 'preg_replace("~\\\\\\\\?.*~", "", ME) . "?file=\1&version=' . $VERSION . '"'; $replace = 'preg_replace("~\\\\\\\\?.*~", "", ME) . "?file=\1&version=' . substr(md5(microtime()), 0, 8) . '"';
$file = preg_replace('~\.\./adminer/static/(default\.css|favicon\.ico)~', '<?php echo h(' . $replace . '); ?>', $file); $file = preg_replace('~\.\./adminer/static/(default\.css|favicon\.ico)~', '<?php echo h(' . $replace . '); ?>', $file);
$file = preg_replace('~"\.\./adminer/static/(functions\.js)"~', $replace, $file); $file = preg_replace('~"\.\./adminer/static/(functions\.js)"~', $replace, $file);
$file = preg_replace('~\.\./adminer/static/([^\'"]*)~', '" . h(' . $replace . ') . "', $file); $file = preg_replace('~\.\./adminer/static/([^\'"]*)~', '" . h(' . $replace . ') . "', $file);

View File

@@ -580,8 +580,11 @@ qsl('div').onclick = whisperClick;", "")
global $VERSION; global $VERSION;
?> ?>
<h1> <h1>
<?php echo $this->name(); ?> <span class="version"><?php echo $VERSION; ?></span> <?php echo $this->name(); ?>
<a href="https://www.adminer.org/editor/#download"<?php echo target_blank(); ?> id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?></a> <?php if ($missing != "auth"): ?>
<span class="version"><?php echo $VERSION; ?></span>
<a href="https://www.adminer.org/editor/#download"<?php echo target_blank(); ?> id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?></a>
<?php endif; ?>
</h1> </h1>
<?php <?php
if ($missing == "auth") { if ($missing == "auth") {