slash in needupdate()

pull/128/head
qkqpttgf 2020-09-13 13:04:58 +08:00 committed by GitHub
parent d48854791f
commit 91d118d567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -925,7 +925,9 @@ function message($message, $title = 'Message', $statusCode = 200)
<body> <body>
<h1>' . $title . '</h1> <h1>' . $title . '</h1>
<p> <p>
' . $message . ' ' . $message . '
</p> </p>
</body> </body>
</html> </html>
@ -934,7 +936,9 @@ function message($message, $title = 'Message', $statusCode = 200)
function needUpdate() function needUpdate()
{ {
$current_version = file_get_contents(__DIR__ . '/version'); $slash = '/';
if (strpos(__DIR__, ':')) $slash = '\\';
$current_version = file_get_contents(__DIR__ . $slash . 'version');
$current_ver = substr($current_version, strpos($current_version, '.')+1); $current_ver = substr($current_version, strpos($current_version, '.')+1);
$current_ver = explode(urldecode('%0A'),$current_ver)[0]; $current_ver = explode(urldecode('%0A'),$current_ver)[0];
$current_ver = explode(urldecode('%0D'),$current_ver)[0]; $current_ver = explode(urldecode('%0D'),$current_ver)[0];