Skip to content
Snippets Groups Projects
Commit 8f1efc43 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

sanity check update message

This should avoid problems when a WiFi login redirect intercepts the
update check.
See https://forum.dokuwiki.org/post/45076
parent 75eee042
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment