Skip to content

Commit

Permalink
Merge pull request #123 from nodiscc/dont-disclose-version
Browse files Browse the repository at this point in the history
Prevent visitors from reading shaarli version
  • Loading branch information
e2jk committed Feb 25, 2015
2 parents 0c57460 + dbcad74 commit 7572cfb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions shaarli_version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php /* 0.0.43beta */ ?>
1 change: 0 additions & 1 deletion shaarli_version.txt

This file was deleted.

0 comments on commit 7572cfb

Please sign in to comment.