Merge pull request #767 from KuJoe/master

Added option to hide HTMLy version publicly and added version to admin layout by @KuJoe
This commit is contained in:
Dan 2024-05-22 22:39:51 +07:00 committed by GitHub
commit 6d92d7044b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 30 additions and 4 deletions

View file

@ -301,4 +301,6 @@ login_protect_system = "Login protection system"
cloudflare_info = "Review Cloudflare's Turnstile documentation: "
mfa_config = "Multi Factor Authentication (MFA)"
set_mfa_globally = "Set the status of MFA"
explain_mfa = "When enabled, MFA is optional for all users. When disabled, no users can use it and it hides the field on the login page."
explain_mfa = "When enabled, MFA is optional for all users. When disabled, no users can use it and it hides the field on the login page."
set_version_publicly = "Version Visibility"
explain_version = "By default the version of HTMLy is visible publicly in the source code, some bots and bad actors can use this information for bad reasons so some admins may prefer to hide this."

View file

@ -140,6 +140,27 @@ Please install and enable the INTL extension to format the date format to your l
<input type="text" name="-config-blog.copyright" class="form-control" id="blog.copyright" value="<?php echo valueMaker(config('blog.copyright'));?>" placeholder="<?php echo i18n('Copyright_Line_Placeholder');?>">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><?php echo i18n('set_version_publicly');?></label>
<div class="col-sm-10">
<div class="col-sm-10">
<div class="form-check">
<input class="form-check-input" type="radio" name="-config-show.version" id="show.version1" value="true" <?php if (config('show.version') === 'true'):?>checked<?php endif;?>>
<label class="form-check-label" for="show.version1">
<?php echo i18n('Enable');?>
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="-config-show.version" id="show.version2" value="false" <?php if (config('show.version') === 'false'):?>checked<?php endif;?>>
<label class="form-check-label" for="show.version2">
<?php echo i18n('Disable');?>
</label>
</div>
</div>
<small><em><?php echo i18n('explain_version');?></em></small>
</div>
</div>
<hr />
<div class="form-group row">
<div class="col-sm-10">
<button type="submit" class="btn btn-primary"><?php echo i18n('Save_Config');?></button>

View file

@ -328,7 +328,7 @@ if (isset($_GET['search'])) {
<small><?php echo i18n('Admin_panel_style_based_on');?> <a rel="nofollow" target="_blank" href="https://github.com/ColorlibHQ/AdminLTE">AdminLTE</a></small>
</div>
<!-- Default to the left -->
<?php echo i18n('Proudly_powered_by');?> <a href="https://www.htmly.com" target="_blank">HTMLy</a>
<?php echo i18n('Proudly_powered_by');?> <a href="https://www.htmly.com" target="_blank"><?php echo 'HTMLy ' . constant('HTMLY_VERSION'); ?></a>
</footer>
</div>
<!-- ./wrapper -->

View file

@ -88,5 +88,6 @@
"views.root",
"views.layout",
"autosave.enable",
"mfa.state"
"mfa.state",
"show.version"
]

View file

@ -3440,7 +3440,9 @@ function head_contents()
$output .= '<meta charset="utf-8" />' . "\n";
$output .= '<meta http-equiv="X-UA-Compatible" content="IE=edge" />' . "\n";
$output .= '<meta name="viewport" content="width=device-width, initial-scale=1" />' . "\n";
$output .= '<meta name="generator" content="' . $version . '" />' . "\n";
if (config('show.version') == 'true') {
$output .= '<meta name="generator" content="' . $version . '" />' . "\n";
}
$output .= $favicon;
$output .= '<link rel="sitemap" href="' . site_url() . 'sitemap.xml" />' . "\n";
$output .= '<link rel="alternate" type="application/rss+xml" title="' . blog_title() . ' Feed" href="' . site_url() . 'feed/rss" />' . "\n";