$serverURL = FileUtil::addTrailingSlash($this->serverURL) . 'list/' . WCF::getLanguage()->getFixedLanguageCode() . '.xml';
$metaData = $this->getMetaData();
- //if (!RemoteFile::supportsSSL() || !$metaData['ssl']) {
- if (!RemoteFile::supportsSSL()) {
+ if (!RemoteFile::supportsSSL() || !$metaData['ssl']) {
return preg_replace('~^https://~', 'http://', $serverURL);
}
- return $serverURL;
+ return preg_replace('~^http://~', 'https://', $serverURL);
}
/**
}
$metaData = $this->getMetaData();
- //if (!RemoteFile::supportsSSL() || !$metaData['ssl']) {
- if (!RemoteFile::supportsSSL()) {
+ if (!RemoteFile::supportsSSL() || !$metaData['ssl']) {
return preg_replace('~^https://~', 'http://', $this->serverURL);
}
- return $this->serverURL;
+ return preg_replace('~^http://~', 'https://', $this->serverURL);
}
/**
if (empty($reply['httpHeaders']['etag']) && empty($reply['httpHeaders']['last-modified'])) {
throw new SystemException("Missing required HTTP headers 'etag' and 'last-modified'.");
}
- /*else if (empty($reply['httpHeaders']['wcf-update-server-ssl'])) {
+ else if (empty($reply['httpHeaders']['wcf-update-server-ssl'])) {
throw new SystemException("Missing required HTTP header 'wcf-update-server-ssl'.");
- }*/
+ }
$metaData['list'] = array();
if (!empty($reply['httpHeaders']['etag'])) $metaData['list']['etag'] = reset($reply['httpHeaders']['etag']);
if (!empty($reply['httpHeaders']['last-modified'])) $metaData['list']['lastModified'] = reset($reply['httpHeaders']['last-modified']);
- $metaData['ssl'] = false;
- //(reset($reply['httpHeaders']['wcf-update-server-ssl']) == 'true') ? true : false;
+ $metaData['ssl'] = (reset($reply['httpHeaders']['wcf-update-server-ssl']) == 'true') ? true : false;
}
$data['metaData'] = serialize($metaData);