Code Duplication    Length = 8-9 lines in 2 locations

ecrire/action/editer_article.php 1 location

@@ 217-224 (lines=8) @@
214
		// sauf si $c commande autre chose
215
		// ou si l'article est deja date dans le futur
216
		// En cas de proposition d'un article (mais pas depublication), idem
217
		if ($champs['statut'] == 'publie'
218
		 OR ($champs['statut'] == 'prop' AND ($d OR !in_array($statut_ancien, array('publie', 'prop'))))
219
		) {
220
			if ($d OR strtotime($d=$date)>time())
221
				$champs['date'] = $date = $d;
222
			else
223
				$champs['date'] = $date = date('Y-m-d H:i:s');
224
		}
225
	}
226
227
	// Verifier que la rubrique demandee existe et est differente

ecrire/action/editer_objet.php 1 location

@@ 307-315 (lines=9) @@
304
		// ou si l'objet est deja date dans le futur
305
		// En cas de proposition d'un objet (mais pas depublication), idem
306
		if ($champ_date) {
307
			if ($champs['statut'] == 'publie'
308
			 OR ($champs['statut'] == 'prop' AND !in_array($statut_ancien, array('publie', 'prop')))
309
			 OR $d
310
			) {
311
				if ($d OR strtotime($d=$date)>time())
312
					$champs[$champ_date] = $date = $d;
313
				else
314
					$champs[$champ_date] = $date = date('Y-m-d H:i:s');
315
			}
316
		}
317
	}
318