X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-updates.php;h=89df15eea14fb18924bd9e3372df32367044ab6a;hp=6d73b593ac92c35a5afeb8b84f40c10502747a4a;hb=ca256746fe0757a23df4064824c8fe2087ad5634;hpb=c2e17d983fcbc0c3bd1dd37908d87c678f0367df diff --git a/inc/modules/admin/what-updates.php b/inc/modules/admin/what-updates.php index 6d73b593ac..89df15eea1 100644 --- a/inc/modules/admin/what-updates.php +++ b/inc/modules/admin/what-updates.php @@ -1,7 +1,7 @@ $v) { - $v = trim($v); - if (empty($v)) { - // Header ends here (+1) - $pos = $k + 1; break; - } - } - - $response2 = array(); - for($i = $pos; $i < count($response); $i++) { - $response2[] = trim($response[$i]); - } - $response = $response2; unset($response2); - unset($pos); + $response = removeHttpHeaderFromResponse($response); // Which is the latest version on server? $ONLINE = array( - 'version' => str_replace("\n", '', $response[0]), - 'changed' => str_replace("\n", '', $response[1]), - 'revision' => str_replace("\n", '', $response[2]), + 'version' => trim(str_replace(PHP_EOL, '', $response[0])), + 'changed' => trim(str_replace(PHP_EOL, '', $response[1])), + 'revision' => trim(str_replace(PHP_EOL, '', $response[2])), 'code' => '200 OK' ); } else { @@ -89,16 +74,19 @@ if (empty($response[0]) && empty($response[1]) && empty($response[2]) && empty($ // Is a newer version available? if (empty($ONLINE['version'])) { // Disconnected? - loadTemplate('admin_settings_saved', false, "
{--ADMIN_CANNOT_CHECK_VERSION--} (".$ONLINE['code'].")
"); -} elseif (($ONLINE['version'] != getConfig('FULL_VERSION')) || ($ONLINE['revision'] != getConfig('CURR_SVN_REVISION'))) { + loadTemplate('admin_settings_unsaved', FALSE, '{--ADMIN_CANNOT_CHECK_VERSION--} (' . $ONLINE['code'] . ')'); +} elseif (($ONLINE['version'] != getFullVersion()) || ($ONLINE['revision'] > getCurrentRepositoryRevision())) { // New full-version available (all previous released patches are included in this version!) $ONLINE['changed'] = generateDateTime($ONLINE['changed'], 2); // Load template - loadTemplate('admin_update_download', false, $ONLINE); + loadTemplate('admin_update_download', FALSE, $ONLINE); +} elseif ($ONLINE['revision'] < getCurrentRepositoryRevision()) { + // Installed revision is newer than on server + displayMessage('{--ADMIN_LOCAL_REVISION_IS_NEWER_THAN_UPDATE--}'); } else { // You have the latest version! - loadTemplate('admin_settings_saved', false, getMessage('NO_UPDATES_AVAILABLE')); + displayMessage('{--ADMIN_NO_UPDATES_AVAILABLE--}'); } // [EOF]