Code Duplication    Length = 8-9 lines in 2 locations

ecrire/action/editer_article.php 1 location

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

ecrire/action/editer_objet.php 1 location

@@ 353-361 (lines=9) @@
350
		// ou si l'objet est deja date dans le futur
351
		// En cas de proposition d'un objet (mais pas depublication), idem
352
		if ($champ_date) {
353
			if ($champs['statut'] == 'publie'
354
				or ($champs['statut'] == 'prop' and !in_array($statut_ancien, array('publie', 'prop')))
355
				or $d
356
			) {
357
				if ($d or strtotime($d = $date) > time()) {
358
					$champs[$champ_date] = $date = $d;
359
				} else {
360
					$champs[$champ_date] = $date = date('Y-m-d H:i:s');
361
				}
362
			}
363
		}
364
	}