properly exit script if no version was detected, for drupal and wordpress (courtesy WvR)

This commit is contained in:
florian
2013-10-15 20:01:44 +00:00
parent 8e4436f9de
commit 5ecd250bac
2 changed files with 11 additions and 8 deletions

View File

@@ -5,8 +5,12 @@ require_once("toolkit.php");
// Retrieve current Wordpress version from http://api.wordpress.org/core/version-check/1.6/
//
$wp_api = unserialize(file_get_contents("http://api.wordpress.org/core/version-check/1.6/"));
$wp_current = $wp_api['offers'][0]['current'];
verbose("Current Wordpress version: $wp_current", 1);
if( isset($wp_api['offers'][0]['current']) ) {
$wp_current = $wp_api['offers'][0]['current'];
verbose("Current Wordpress version: $wp_current", 1);
} else {
die("Unable to determine current Wordpress version, exiting\n");
}
checkHost(null, $wp_current);
if( $hosts != null ) {