/***************************************************************************\
* SPIP, Systeme de publication pour l'internet *
* *
- * Copyright (c) 2001-2011 *
+ * Copyright (c) 2001-2014 *
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
* *
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
array_shift($regs);
return $regs;
} else {
- $arg = '\s*\'([^\']*)\'\s*,';
- if (preg_match("#spip_connect_db\($arg$arg$arg$arg\s*'([^']*)'\s*(?:,\s*'([^']*))?#", $s, $regs)) {
+ $ar = '\s*\'([^\']*)\'';
+ $r = '\s*,' . $ar;
+ $r = "#spip_connect_db[(]$ar$r$r$r$r(?:$r(?:$r(?:$r)?)?)?#";
+ if (preg_match($r, $s, $regs)) {
$regs[2] = $regs[1] . (!$regs[2] ? '' : ":$port_db;");
array_shift($regs);
array_shift($regs);
}
}
spip_log("$file n'est pas un fichier de connexion");
- return '';
+ return array();
}
// http://doc.spip.org/@bases_referencees