Code Duplication    Length = 11-11 lines in 3 locations

ecrire/req/pg.exp.php 1 location

@@ 1209-1219 (lines=11) @@
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
1221
function spip_pg_date_proche($champ, $interval, $unite) {
1222
	return '('

ecrire/req/sqlite_generique.php 1 location

@@ 1337-1347 (lines=11) @@
1334
 * @return string|number
1335
 *    Donnée prête à être utilisée par le gestionnaire SQL
1336
 */
1337
function spip_sqlite_quote($v, $type = '') {
1338
	if (!is_array($v)) {
1339
		return _sqlite_calculer_cite($v, $type);
1340
	}
1341
	// si c'est un tableau, le parcourir en propageant le type
1342
	foreach ($v as $k => $r) {
1343
		$v[$k] = spip_sqlite_quote($r, $type);
1344
	}
1345
1346
	return join(",", $v);
1347
}
1348
1349
1350
/**

ecrire/req/mysql.php 1 location

@@ 1524-1534 (lines=11) @@
1521
 * @return string|number
1522
 *    Donnée prête à être utilisée par le gestionnaire SQL
1523
 */
1524
function spip_mysql_quote($v, $type = '') {
1525
	if (!is_array($v)) {
1526
		return spip_mysql_cite($v, $type);
1527
	}
1528
1529
	// si c'est un tableau, le parcourir en propageant le type
1530
	foreach ($v as $k => $r) {
1531
		$v[$k] = spip_mysql_quote($r, $type);
1532
	}
1533
	return implode(',', $v);
1534
}
1535
1536
/**
1537
 * Tester si une date est proche de la valeur d'un champ