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

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