Code Duplication    Length = 8-11 lines in 2 locations

ecrire/inc/plugin.php 2 locations

@@ 490-497 (lines=8) @@
487
			$info1 = $infos[$dir_type][$plug];
488
			// si des plugins sont necessaires,
489
			// on ne peut inserer qu'apres eux
490
			foreach ($info1['necessite'] as $need) {
491
				$nom = strtoupper($need['nom']);
492
				$compat = isset($need['compatibilite']) ? $need['compatibilite'] : '';
493
				if (!isset($liste[$nom]) or !plugin_version_compatible($compat, $liste[$nom]['version'])) {
494
					$info1 = false;
495
					break;
496
				}
497
			}
498
			if (!$info1) {
499
				continue;
500
			}
@@ 503-513 (lines=11) @@
500
			}
501
			// idem si des plugins sont utiles,
502
			// sauf si ils sont de toute facon absents de la liste
503
			foreach ($info1['utilise'] as $need) {
504
				$nom = strtoupper($need['nom']);
505
				$compat = isset($need['compatibilite']) ? $need['compatibilite'] : '';
506
				if (isset($toute_la_liste[$nom])) {
507
					if (!isset($liste[$nom]) or
508
						!plugin_version_compatible($compat, $liste[$nom]['version'])
509
					) {
510
						$info1 = false;
511
						break;
512
					}
513
				}
514
			}
515
			if ($info1) {
516
				$ordre[$p] = $info1;