Code Duplication    Length = 5-6 lines in 2 locations

ecrire/req/pg.exp.php 1 location

@@ 1410-1414 (lines=5) @@
1407
1408
	foreach ($champs as $k => $v) {
1409
		$k = str_replace('`', '"', $k);
1410
		if (preg_match(',([a-z]*\s*(\(\s*[0-9]*\s*\))?(\s*binary)?),i', $v, $defs)) {
1411
			if (preg_match(',(char|text),i', $defs[1]) and !preg_match(',binary,i', $defs[1])) {
1412
				$v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1]));
1413
			}
1414
		}
1415
1416
		$query .= "$s\n\t\t$k "
1417
			. (($autoinc && ($prim_name == $k) && preg_match(',\b(big|small|medium|tiny)?int\b,i', $v))

ecrire/req/mysql.php 1 location

@@ 685-690 (lines=6) @@
682
683
	foreach ($champs as $k => $v) {
684
		$v = _mysql_remplacements_definitions_table($v);
685
		if (preg_match(',([a-z]*\s*(\(\s*[0-9]*\s*\))?(\s*binary)?),i', $v, $defs)) {
686
			if (preg_match(',(char|text),i', $defs[1])
687
				and !preg_match(',(binary|CHARACTER|COLLATE),i', $v)
688
			) {
689
				$v = $defs[1] . $character_set . ' ' . substr($v, strlen($defs[1]));
690
			}
691
		}
692
693
		$query .= "$s\n\t\t$k $v"