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

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