summaryrefslogtreecommitdiff
path: root/inc/infoutils.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2014-08-15 11:47:22 +0200
committerAndreas Gohr <andi@splitbrain.org>2014-08-15 11:50:40 +0200
commit8f1efc437b686ec79c258f63e550f7bfec5c2b06 (patch)
treead6825e9e1bbe299ea096029f902247faf3a18ce /inc/infoutils.php
parent75eee04265a91b0836be9cb678281c44f6b653d8 (diff)
downloadrpg-8f1efc437b686ec79c258f63e550f7bfec5c2b06.tar.gz
rpg-8f1efc437b686ec79c258f63e550f7bfec5c2b06.tar.bz2
sanity check update message
This should avoid problems when a WiFi login redirect intercepts the update check. See https://forum.dokuwiki.org/post/45076
Diffstat (limited to 'inc/infoutils.php')
-rw-r--r--inc/infoutils.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/inc/infoutils.php b/inc/infoutils.php
index db856141f..f9ba11560 100644
--- a/inc/infoutils.php
+++ b/inc/infoutils.php
@@ -30,7 +30,12 @@ function checkUpdateMessages(){
$http = new DokuHTTPClient();
$http->timeout = 12;
$data = $http->get(DOKU_MESSAGEURL.$updateVersion);
- io_saveFile($cf,$data);
+ if(substr(trim($data), -1) != '%') {
+ // this doesn't look like one of our messages, maybe some WiFi login interferred
+ $data = '';
+ }else {
+ io_saveFile($cf,$data);
+ }
}else{
dbglog("checkUpdateMessages(): messages.txt up to date");
$data = io_readFile($cf);