Code Duplication    Length = 8-9 lines in 2 locations

ecrire/action/editer_article.php 1 location

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

ecrire/action/editer_objet.php 1 location

@@ 365-373 (lines=9) @@
362
		// ou si l'objet est deja date dans le futur
363
		// En cas de proposition d'un objet (mais pas depublication), idem
364
		if ($champ_date) {
365
			if ($champs['statut'] == 'publie'
366
				or ($champs['statut'] == 'prop' and !in_array($statut_ancien, array('publie', 'prop')))
367
				or $d
368
			) {
369
				if ($d or strtotime($d = $date) > time()) {
370
					$champs[$champ_date] = $date = $d;
371
				} else {
372
					$champs[$champ_date] = $date = date('Y-m-d H:i:s');
373
				}
374
			}
375
		}
376
	}