Merge pull request #123 from nodiscc/dont-disclose-version

Prevent visitors from reading shaarli version
This commit is contained in:
Emilien Klein 2015-02-25 21:41:56 +01:00
commit 7572cfbe96
3 changed files with 3 additions and 3 deletions

View File

@ -184,8 +184,8 @@ function checkUpdate()
if (!is_file($GLOBALS['config']['UPDATECHECK_FILENAME']) || (filemtime($GLOBALS['config']['UPDATECHECK_FILENAME'])<time()-($GLOBALS['config']['UPDATECHECK_INTERVAL'])))
{
$version=shaarli_version;
list($httpstatus,$headers,$data) = getHTTP('https://raw.githubusercontent.com/shaarli/Shaarli/master/shaarli_version.txt',2);
if (strpos($httpstatus,'200 OK')!==false) $version=$data;
list($httpstatus,$headers,$data) = getHTTP('https://raw.githubusercontent.com/shaarli/Shaarli/master/shaarli_version.php',2);
if (strpos($httpstatus,'200 OK')!==false) $version=str_replace(' */ ?>','',str_replace('<?php /* ','',$data));
// If failed, never mind. We don't want to bother the user with that.
file_put_contents($GLOBALS['config']['UPDATECHECK_FILENAME'],$version); // touch file date
}

1
shaarli_version.php Normal file
View File

@ -0,0 +1 @@
<?php /* 0.0.43beta */ ?>

View File

@ -1 +0,0 @@
0.0.43beta