-
- // sinon dans les paquets distants
- $distants = $this->infos_courtes(array(
- 'pl.prefixe=' . sql_quote($prefixe),
- 'pa.obsolete=' . sql_quote('non'),
- 'pa.id_depot>'.sql_quote(0)), true);
- if ($distants and isset($distants['p'][$prefixe]) and count($distants['p'][$prefixe]) > 0) {
- foreach ($distants['p'][$prefixe] as $new) {
- if (plugin_version_compatible($version, $new['v'])
- and svp_verifier_compatibilite_spip($new['compatibilite_spip']) ){
- return $new;
+
+ if (!$plugin) {
+ // sinon dans les paquets distants
+ $distants = $this->infos_courtes(array(
+ 'pl.prefixe=' . sql_quote($prefixe),
+ 'pa.obsolete=' . sql_quote('non'),
+ 'pa.id_depot>'.sql_quote(0)), true);
+ if ($distants and isset($distants['p'][$prefixe]) and count($distants['p'][$prefixe]) > 0) {
+ $v = '000.000.000';
+ foreach ($distants['p'][$prefixe] as $new) {
+ if (plugin_version_compatible($version, $new['v'])
+ and svp_verifier_compatibilite_spip($new['compatibilite_spip'])
+ and ($new['v'] > $v)){
+ $plugin = $new;
+ $v = $new['v'];
+ }