handle failing version check when allow_url_fopen is set to false (closes: #57)

This commit is contained in:
Christoph Anton Mitterer 2016-12-02 21:57:24 +01:00 committed by Florian Schlichting
parent a4ba019397
commit 70bd8cf0ce

View File

@ -252,6 +252,8 @@ function check_schema_version() {
function check_davical_version() {
global $c;
if ( ! ini_get('allow_url_fopen') )
return new CheckResult( false, translate("Cannot determine upstream version, because PHP has set “<a href=\"http://php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen\"><code>allow_url_fopen</code></a>” to “<code>FALSE</code>”."), 'dep_warning' );
$url = 'http://www.davical.org/current_davical_version?v='.$c->version_string;
$version_file = @fopen($url, 'r');
if ( ! $version_file ) return new CheckResult( false, translate("Could not retrieve") . " '$url'", 'dep_warning' );