diff --git a/l10n_update.compare.inc b/l10n_update.compare.inc index f222ce7b..8cd74a21 100644 --- a/l10n_update.compare.inc +++ b/l10n_update.compare.inc @@ -47,16 +47,17 @@ function l10n_update_build_projects($refresh = FALSE) { $default_server = l10n_update_default_translation_server(); foreach ($projects as $name => $data) { - // For dev releases, remove the '-dev' part and trust the translation - // server to fall back to the latest stable release for that branch. + // For dev releases, remove the '-dev' or '+xx-dev' part and fall back to + // the unmodified release for that branch. if (isset($data['info']['version']) && strpos($data['info']['version'], '-dev')) { - if (preg_match("/^(\d+\.x-\d+\.).*$/", $data['info']['version'], $matches)) { - // Example matches: 7.x-1.x-dev, 7.x-1.0-alpha1+5-dev => 7.x-1.x. - $data['info']['version'] = $matches[1] . 'x'; + // Version ahead of release? Split on '+', otherwise just on '-dev'. + if (strpos($data['info']['version'], "+")) { + $version_array = explode("+", $data['info']['version']); + $data['info']['version'] = $version_array[0]; } - elseif (preg_match("/^(\d+\.).*$/", $data['info']['version'], $matches)) { - // Example match: 7.33-dev => 7.x (Drupal core). - $data['info']['version'] = $matches[1] . 'x'; + else { + $version_array = explode("-dev", $data['info']['version']); + $data['info']['version'] = $version_array[0]; } }