Code Duplication    Length = 6-9 lines in 2 locations

ecrire/req/sqlite_generique.php 1 location

@@ 1999-2007 (lines=9) @@
1996
				return intval($v);
1997
			}
1998
		}
1999
	} else {
2000
		// si on ne connait pas le type on le deduit de $v autant que possible
2001
		if (is_bool($v)) {
2002
			return strval(intval($v));
2003
		}
2004
		elseif (is_numeric($v)) {
2005
			return strval($v);
2006
		}
2007
	}
2008
2009
	// trouver un link sqlite pour faire l'echappement
2010
	foreach ($GLOBALS['connexions'] as $s) {

ecrire/req/mysql.php 1 location

@@ 1597-1602 (lines=6) @@
1594
 */
1595
function spip_mysql_cite($v, $type) {
1596
	if (!$type) {
1597
		if (is_bool($v)) {
1598
			return strval(intval($v));
1599
		}
1600
		elseif (is_numeric($v)) {
1601
			return strval($v);
1602
		}
1603
		return "'" . addslashes($v) . "'";
1604
	}
1605