Code Duplication    Length = 8-8 lines in 2 locations

ecrire/inc/texte_mini.php 2 locations

@@ 408-415 (lines=8) @@
405
// http://code.spip.net/@protege_js_modeles
406
function protege_js_modeles($t) {
407
	if (isset($GLOBALS['visiteur_session'])) {
408
		if (preg_match_all(',<script.*?($|</script.),isS', $t, $r, PREG_SET_ORDER)) {
409
			if (!defined('_PROTEGE_JS_MODELES')) {
410
				include_spip('inc/acces');
411
				define('_PROTEGE_JS_MODELES', creer_uniqid());
412
			}
413
			foreach ($r as $regs) {
414
				$t = str_replace($regs[0], code_echappement($regs[0], 'javascript' . _PROTEGE_JS_MODELES), $t);
415
			}
416
		}
417
		if (preg_match_all(',<\?php.*?($|\?' . '>),isS', $t, $r, PREG_SET_ORDER)) {
418
			if (!defined('_PROTEGE_PHP_MODELES')) {
@@ 417-424 (lines=8) @@
414
				$t = str_replace($regs[0], code_echappement($regs[0], 'javascript' . _PROTEGE_JS_MODELES), $t);
415
			}
416
		}
417
		if (preg_match_all(',<\?php.*?($|\?' . '>),isS', $t, $r, PREG_SET_ORDER)) {
418
			if (!defined('_PROTEGE_PHP_MODELES')) {
419
				include_spip('inc/acces');
420
				define('_PROTEGE_PHP_MODELES', creer_uniqid());
421
			}
422
			foreach ($r as $regs) {
423
				$t = str_replace($regs[0], code_echappement($regs[0], 'php' . _PROTEGE_PHP_MODELES), $t);
424
			}
425
		}
426
	}
427