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/mysql.php 1 location

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

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