'thunderbird',
'version' => $row[1],
'filename' => str_replace('__DOMAIN__', $_GET["domain"], $row[2]),
);
if (count($row) > 3)
{
$plugins[$row[0]]['min_version'] = $row[3];
}
else
{
$plugins[$row[0]]['min_version'] = '30.0';
}
}
fclose($fh);
}
}
$applications
= array( "thunderbird" => "{3550f703-e582-4d05-9a08-453d09bdfdc6}
__MIN_VERSION__
99.*" );
$pluginname = $_GET["plugin"];
$plugin =& $plugins[$pluginname];
$application =& $applications[$plugin["application"]];
if ( $plugin ) {
$platform = $_GET["platform"];
if ( $platform
&& file_exists( $platform . "/" . $plugin["filename"] ) ) {
$plugin["filename"] = $platform . "/" . $plugin["filename"];
}
elseif ( !file_exists( $plugin["filename"] ) ) {
$plugin = false;
}
}
if (preg_match('/Thunderbird\/([0-9\.]+)/', $_SERVER['HTTP_USER_AGENT'], $client_ver))
{
$client_ver = $client_ver[1];
}
else
{
$client_ver = $plugin['min_version'];
}
if ( $plugin ) {
if (version_compare($client_ver, $plugin['min_version'], '<')) {
header("Content-type: text/plain; charset=utf-8", true, 404);
echo( 'Plugin not compatible with client version' );
exit;
}
header("Content-type: text/xml; charset=utf-8");
echo ('' . "\n");
?>