Code Duplication    Length = 8-14 lines in 3 locations

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
	}

ecrire/req/sqlite_generique.php 1 location

@@ 1353-1360 (lines=8) @@
1350
 * @return string|number
1351
 *    Donnée prête à être utilisée par le gestionnaire SQL
1352
 */
1353
function spip_sqlite_quote($v, $type = '') {
1354
	if (!is_array($v)) {
1355
		return _sqlite_calculer_cite($v, $type);
1356
	}
1357
	// si c'est un tableau, le parcourir en propageant le type
1358
	foreach ($v as $k => $r) {
1359
		$v[$k] = spip_sqlite_quote($r, $type);
1360
	}
1361
1362
	return join(",", $v);
1363
}