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

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