Code Duplication    Length = 8-14 lines in 3 locations

ecrire/req/sqlite_generique.php 1 location

@@ 1424-1431 (lines=8) @@
1421
 * @return string|number
1422
 *    Donnée prête à être utilisée par le gestionnaire SQL
1423
 */
1424
function spip_sqlite_quote($v, $type = '') {
1425
	if (!is_array($v)) {
1426
		return _sqlite_calculer_cite($v, $type);
1427
	}
1428
	// si c'est un tableau, le parcourir en propageant le type
1429
	foreach ($v as $k => $r) {
1430
		$v[$k] = spip_sqlite_quote($r, $type);
1431
	}
1432
1433
	return join(",", $v);
1434
}

ecrire/req/pg.exp.php 1 location

@@ 1209-1217 (lines=9) @@
1206
	return "CAST(x'" . $v . "' as bigint)";
1207
}
1208
1209
function spip_pg_quote($v, $type = '') {
1210
	if (!is_array($v)) {
1211
		return spip_pg_cite($v, $type);
1212
	}
1213
	// si c'est un tableau, le parcourir en propageant le type
1214
	foreach ($v as $k => $r) {
1215
		$v[$k] = spip_pg_quote($r, $type);
1216
	}
1217
1218
	return join(",", $v);
1219
}
1220

ecrire/req/mysql.php 1 location

@@ 1514-1527 (lines=14) @@
1511
 * @return string|number
1512
 *    Donnée prête à être utilisée par le gestionnaire SQL
1513
 */
1514
function spip_mysql_quote($v, $type = '') {
1515
	if ($type) {
1516
		if (!is_array($v)) {
1517
			return spip_mysql_cite($v, $type);
1518
		}
1519
		// si c'est un tableau, le parcourir en propageant le type
1520
		foreach ($v as $k => $r) {
1521
			$v[$k] = spip_mysql_quote($r, $type);
1522
		}
1523
1524
		return $v;
1525
	}
1526
	// si on ne connait pas le type, s'en remettre a _q :
1527
	// on ne fera pas mieux
1528
	else {
1529
		return _q($v);
1530
	}