Code Duplication    Length = 2-5 lines in 6 locations

ecrire/xml/analyser_dtd.php 1 location

@@ 98-99 (lines=2) @@
95
	// si DTD locale, ignorer ce repertoire pour le moment
96
	if ($avail == 'SYSTEM') {
97
		$file = $loc;
98
		if (_DIR_RACINE and strncmp($file, _DIR_RACINE, strlen(_DIR_RACINE)) == 0) {
99
			$file = substr($file, strlen(_DIR_RACINE));
100
		}
101
		$file = find_in_path($file);
102
	} else {

ecrire/inc/distant.php 1 location

@@ 80-84 (lines=5) @@
77
78
	if (is_null($local)) {
79
		$local = fichier_copie_locale($source);
80
	} else {
81
		if (_DIR_RACINE and strncmp(_DIR_RACINE, $local, strlen(_DIR_RACINE)) == 0) {
82
			$local = substr($local, strlen(_DIR_RACINE));
83
		}
84
	}
85
86
	// si $local = '' c'est un fichier refuse par fichier_copie_locale(),
87
	// par exemple un fichier qui ne figure pas dans nos documents ;

ecrire/inc/log.php 1 location

@@ 70-71 (lines=2) @@
67
		$debug = debug_backtrace();
68
		$l = $debug[1]['line'];
69
		$fi = $debug[1]['file'];
70
		if (strncmp($fi, _ROOT_RACINE, strlen(_ROOT_RACINE)) == 0) {
71
			$fi = substr($fi, strlen(_ROOT_RACINE));
72
		}
73
		$fu = isset($debug[2]['function']) ? $debug[2]['function'] : '';
74
		$debugverb = "$fi:L$l:$fu" . '():';

ecrire/plugins/afficher_plugin.php 1 location

@@ 234-235 (lines=2) @@
231
// https://code.spip.net/@plugin_propre
232
function plugin_propre($texte, $module = '',$propre='propre') {
233
	// retirer le retour a la racine du module, car le find_in_path se fait depuis la racine
234
	if (_DIR_RACINE and strncmp($module, _DIR_RACINE, strlen(_DIR_RACINE)) == 0) {
235
		$module = substr($module, strlen(_DIR_RACINE));
236
	}
237
	if (preg_match("|^\w+_[\w_]+$|", $texte)) {
238
		$texte = _T(($module ? "$module:" : '') . $texte, array(), array('force' => false));

ecrire/public/composer.php 2 locations

@@ 427-429 (lines=3) @@
424
	// Attention sous windows, getFileName() retourne un antislash. 
425
	$reflector = new ReflectionFunction($fonction_balise);
426
	$file = str_replace('\\', '/', $reflector->getFileName());
427
	if (strncmp($file, str_replace('\\', '/', _ROOT_RACINE), strlen(_ROOT_RACINE)) === 0) {
428
		$file = substr($file, strlen(_ROOT_RACINE));
429
	}
430
431
	// Y a-t-il une fonction de traitement des arguments ?
432
	$f = 'balise_' . $nom_balise . '_stat';
@@ 1018-1019 (lines=2) @@
1015
// https://code.spip.net/@calculer_nom_fonction_squel
1016
function calculer_nom_fonction_squel($skel, $mime_type = 'html', $connect = '') {
1017
	// ne pas doublonner les squelette selon qu'ils sont calcules depuis ecrire/ ou depuis la racine
1018
	if ($l = strlen(_DIR_RACINE) and strncmp($skel, _DIR_RACINE, $l) == 0) {
1019
		$skel = substr($skel, strlen(_DIR_RACINE));
1020
	}
1021
1022
	return $mime_type