Remove version check
This commit is contained in:
@@ -26,13 +26,6 @@ $separator = PMA_get_arg_separator('html');
|
||||
// message handling
|
||||
messages_begin();
|
||||
|
||||
//
|
||||
// Check phpMyAdmin version
|
||||
//
|
||||
if (isset($_GET['version_check'])) {
|
||||
PMA_version_check();
|
||||
}
|
||||
|
||||
//
|
||||
// Perform various security, compatibility and consistency checks
|
||||
//
|
||||
@@ -226,5 +219,4 @@ display_form_bottom();
|
||||
<div id="footer">
|
||||
<a href="http://phpmyadmin.net"><?php echo __('phpMyAdmin homepage') ?></a>
|
||||
<a href="http://sourceforge.net/donate/index.php?group_id=23067"><?php echo __('Donate') ?></a>
|
||||
<a href="?version_check=1<?php echo "{$separator}token=" . $_SESSION[' PMA_token '] ?>"><?php echo __('Check for latest version') ?></a>
|
||||
</div>
|
||||
|
@@ -89,84 +89,6 @@ function messages_show_html()
|
||||
echo "\n</script>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for newest phpMyAdmin version and sets result as a new notice
|
||||
*/
|
||||
function PMA_version_check()
|
||||
{
|
||||
// version check messages should always be visible so let's make
|
||||
// a unique message id each time we run it
|
||||
$message_id = uniqid('version_check');
|
||||
// wait 3s at most for server response, it's enough to get information
|
||||
// from a working server
|
||||
$connection_timeout = 3;
|
||||
|
||||
$url = 'http://phpmyadmin.net/home_page/version.php';
|
||||
$context = stream_context_create(array(
|
||||
'http' => array(
|
||||
'timeout' => $connection_timeout)));
|
||||
$data = @file_get_contents($url, null, $context);
|
||||
if ($data === false) {
|
||||
if (function_exists('curl_init')) {
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, $connection_timeout);
|
||||
$data = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
} else {
|
||||
messages_set('error', $message_id, __('Version check'),
|
||||
__('Neither URL wrapper nor CURL is available. Version check is not possible.'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($data)) {
|
||||
messages_set('error', $message_id, __('Version check'),
|
||||
__('Reading of version failed. Maybe you\'re offline or the upgrade server does not respond.'));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Format: version\ndate\n(download\n)* */
|
||||
$data_list = explode("\n", $data);
|
||||
|
||||
if (count($data_list) > 1) {
|
||||
$version = $data_list[0];
|
||||
$date = $data_list[1];
|
||||
} else {
|
||||
$version = $date = '';
|
||||
}
|
||||
|
||||
$version_upstream = version_to_int($version);
|
||||
if ($version_upstream === false) {
|
||||
messages_set('error', $message_id, __('Version check'),
|
||||
__('Got invalid version string from server'));
|
||||
return;
|
||||
}
|
||||
|
||||
$version_local = version_to_int($GLOBALS['PMA_Config']->get('PMA_VERSION'));
|
||||
if ($version_local === false) {
|
||||
messages_set('error', $message_id, __('Version check'),
|
||||
__('Unparsable version string'));
|
||||
return;
|
||||
}
|
||||
|
||||
if ($version_upstream > $version_local) {
|
||||
$version = htmlspecialchars($version);
|
||||
$date = htmlspecialchars($date);
|
||||
messages_set('notice', $message_id, __('Version check'),
|
||||
sprintf(__('A newer version of phpMyAdmin is available and you should consider upgrading. The newest version is %s, released on %s.'), $version, $date));
|
||||
} else {
|
||||
if ($version_local % 100 == 0) {
|
||||
messages_set('notice', $message_id, __('Version check'),
|
||||
PMA_sanitize(sprintf(__('You are using Git version, run [kbd]git pull[/kbd] :-)[br]The latest stable version is %s, released on %s.'), $version, $date)));
|
||||
} else {
|
||||
messages_set('notice', $message_id, __('Version check'),
|
||||
__('No newer stable version is available'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates numerical equivalent of phpMyAdmin version string
|
||||
*
|
||||
|
@@ -111,15 +111,6 @@ div.notice h4 {
|
||||
border-color: #FFD700;
|
||||
}
|
||||
|
||||
div.notice[id^=version_check] {
|
||||
border-color: #002DFF;
|
||||
background-color: #EEF;
|
||||
}
|
||||
|
||||
div.notice[id^=version_check] h4 {
|
||||
border-color: #002DFF;
|
||||
}
|
||||
|
||||
div.warning {
|
||||
border-color: #C00;
|
||||
background-color: #FFC;
|
||||
|
Reference in New Issue
Block a user