fix some minor bugs

This commit is contained in:
joyqi 2017-10-13 11:03:38 +08:00
parent eeedef972a
commit 242fc1a4cb
4 changed files with 3 additions and 4 deletions

View File

@ -47,7 +47,7 @@ if (!$user->logged && !Typecho_Cookie::get('__typecho_first_run') && !empty($cur
$mustUpgrade = (!defined('Typecho_Common::VERSION') || version_compare(str_replace('/', '.', Typecho_Common::VERSION),
str_replace('/', '.', $options->version), '>'));
if ($mustUpgrade && 'upgrade.php' != $adminFile) {
if ($mustUpgrade && 'upgrade.php' != $adminFile && 'backup.php' != $adminFile) {
$response->redirect(Typecho_Common::url('upgrade.php', $options->adminUrl));
} else if (!$mustUpgrade && 'upgrade.php' == $adminFile) {
$response->redirect($options->adminUrl);

View File

@ -17,7 +17,7 @@ include 'menu.php';
<ul>
<li><?php _e('您已经更新了系统程序, 我们还需要执行一些后续步骤来完成升级'); ?></li>
<li><?php _e('此程序将把您的系统从 <strong>%s</strong> 升级到 <strong>%s</strong>', $options->version, Typecho_Common::VERSION); ?></li>
<li><strong class="warning"><?php _e('在升级之前强烈建议先备份您的数据'); ?></strong></li>
<li><strong class="warning"><?php _e('在升级之前强烈建议先<a href="%s">备份您的数据</a>', Typecho_Common::url('backup.php', $options->adminUrl)); ?></strong></li>
</ul>
<p><button class="btn primary" type="submit"><?php _e('完成升级 &raquo;'); ?></button></p>
</form>

View File

@ -1120,7 +1120,7 @@ EOF;
$address = gethostbyname($host);
$inet = inet_pton($address);
if ($inet === false) {
if (false === $inet) {
// 有可能是ipv6的地址
$records = dns_get_record($host, DNS_AAAA);

View File

@ -65,7 +65,6 @@ class Widget_Backup extends Widget_Abstract_Options implements Widget_Interface_
private function extractData($file)
{
$fp = @fopen($file, 'rb');
$end = false;
if (!$fp) {
$this->widget('Widget_Notice')->set(_t('无法读取备份文件'), 'error');