diff options
author | Emilien Klein <emilien@klein.st> | 2015-02-25 21:41:56 +0100 |
---|---|---|
committer | Emilien Klein <emilien@klein.st> | 2015-02-25 21:41:56 +0100 |
commit | 7572cfbe9620b13569ee47337f7015bcad119332 (patch) | |
tree | 3a3078a99295182d810cf86b5fb62b9e3abe4279 | |
parent | 0c5746061e49fb857ce2c170ade8ad7dc594a405 (diff) | |
parent | dbcad7406eedaeba259a6e1584ba3b0823115c8d (diff) | |
download | Shaarli-7572cfbe9620b13569ee47337f7015bcad119332.tar.gz Shaarli-7572cfbe9620b13569ee47337f7015bcad119332.tar.zst Shaarli-7572cfbe9620b13569ee47337f7015bcad119332.zip |
Merge pull request #123 from nodiscc/dont-disclose-version
Prevent visitors from reading shaarli version
-rw-r--r-- | index.php | 4 | ||||
-rw-r--r-- | shaarli_version.php | 1 | ||||
-rw-r--r-- | shaarli_version.txt | 1 |
3 files changed, 3 insertions, 3 deletions
@@ -184,8 +184,8 @@ function checkUpdate() | |||
184 | if (!is_file($GLOBALS['config']['UPDATECHECK_FILENAME']) || (filemtime($GLOBALS['config']['UPDATECHECK_FILENAME'])<time()-($GLOBALS['config']['UPDATECHECK_INTERVAL']))) | 184 | if (!is_file($GLOBALS['config']['UPDATECHECK_FILENAME']) || (filemtime($GLOBALS['config']['UPDATECHECK_FILENAME'])<time()-($GLOBALS['config']['UPDATECHECK_INTERVAL']))) |
185 | { | 185 | { |
186 | $version=shaarli_version; | 186 | $version=shaarli_version; |
187 | list($httpstatus,$headers,$data) = getHTTP('https://raw.githubusercontent.com/shaarli/Shaarli/master/shaarli_version.txt',2); | 187 | list($httpstatus,$headers,$data) = getHTTP('https://raw.githubusercontent.com/shaarli/Shaarli/master/shaarli_version.php',2); |
188 | if (strpos($httpstatus,'200 OK')!==false) $version=$data; | 188 | if (strpos($httpstatus,'200 OK')!==false) $version=str_replace(' */ ?>','',str_replace('<?php /* ','',$data)); |
189 | // If failed, never mind. We don't want to bother the user with that. | 189 | // If failed, never mind. We don't want to bother the user with that. |
190 | file_put_contents($GLOBALS['config']['UPDATECHECK_FILENAME'],$version); // touch file date | 190 | file_put_contents($GLOBALS['config']['UPDATECHECK_FILENAME'],$version); // touch file date |
191 | } | 191 | } |
diff --git a/shaarli_version.php b/shaarli_version.php new file mode 100644 index 00000000..d266380a --- /dev/null +++ b/shaarli_version.php | |||
@@ -0,0 +1 @@ | |||
<?php /* 0.0.43beta */ ?> | |||
diff --git a/shaarli_version.txt b/shaarli_version.txt deleted file mode 100644 index b6cffb3a..00000000 --- a/shaarli_version.txt +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | 0.0.43beta | ||