From 3013647556023ce505c19a73e5a5bc52fee9b42f Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Wed, 22 Jan 2020 23:35:52 +0800 Subject: [PATCH] Update common.php --- function/common.php | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/function/common.php b/function/common.php index 197d259..53da41c 100644 --- a/function/common.php +++ b/function/common.php @@ -244,19 +244,17 @@ function message($message, $title = 'Message', $statusCode = 200) function needUpdate() { - if ($_SERVER['admin']) { - $current_ver = file_get_contents(__DIR__ . '/../version'); - $current_ver = substr($current_ver, strpos($current_ver, '.')+1); - $current_ver = explode(urldecode('%0A'),$current_ver)[0]; - $current_ver = explode(urldecode('%0D'),$current_ver)[0]; - $github_version = file_get_contents('https://raw.githubusercontent.com/qkqpttgf/OneManager-php/master/version'); - $github_ver = substr($github_version, strpos($github_version, '.')+1); - $github_ver = explode(urldecode('%0A'),$github_ver)[0]; - $github_ver = explode(urldecode('%0D'),$github_ver)[0]; - if ($current_ver != $github_ver) { - $_SERVER['github_version'] = $github_version; - return 1; - } + $current_ver = file_get_contents(__DIR__ . '/../version'); + $current_ver = substr($current_ver, strpos($current_ver, '.')+1); + $current_ver = explode(urldecode('%0A'),$current_ver)[0]; + $current_ver = explode(urldecode('%0D'),$current_ver)[0]; + $github_version = file_get_contents('https://raw.githubusercontent.com/qkqpttgf/OneManager-php/master/version'); + $github_ver = substr($github_version, strpos($github_version, '.')+1); + $github_ver = explode(urldecode('%0A'),$github_ver)[0]; + $github_ver = explode(urldecode('%0D'),$github_ver)[0]; + if ($current_ver != $github_ver) { + $_SERVER['github_version'] = $github_version; + return 1; } return 0; }