sanity check update message

This should avoid problems when a WiFi login redirect intercepts the
update check.
See https://forum.dokuwiki.org/post/45076
This commit is contained in:
Andreas Gohr 2014-08-15 11:47:22 +02:00
parent 75eee04265
commit 8f1efc437b
1 changed files with 6 additions and 1 deletions

View File

@ -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);