--- SQL.php	2008-09-15 18:19:58.000000000 +0200
+++ /opt/INTRINsec/vulture/www/WEB-INF/classes/SQL.php	2010-05-20 13:55:26.000000000 +0200
@@ -41,7 +41,7 @@
 	}
 	
 	function getDbName() {
-		if (ereg("dbi:[[:alnum:]]*:dbname=(([:alnum:]:)?[[:alnum:]:\\/_]*)",$this->getUri(), $regs)) return $regs[1]; 
+		if (ereg("dbi:[[:alnum:]]*:(dbname|database)=(([:alnum:]:)?[[:alnum:]:\\/_]*)",$this->getUri(), $regs)) return $regs[1]; 
 	}
 	
 	function setDbName($db_name) {
@@ -49,7 +49,7 @@
 	}
 
 	function getDbHost() {
-		if (ereg(".*;host=([[:alnum:]\-\._]*)",$this->getUri(), $regs)) return $regs[1];
+		if (ereg(".*;(host|server)=([[:alnum:]\-\._]*)",$this->getUri(), $regs)) return $regs[2];
 	}
 
 	function getDbPort() {
@@ -57,16 +57,19 @@
 	}
 
 	function setDbHost($host) {
-		if ($this->getDbType() == "Pg" || $this->getDbType() == "mysql") {
+	  if ($this->getDbType() == "Pg" || $this->getDbType() == "mysql") {
 			list($host, $port) = split(":", $host);
 			if ($port)
 				$host .= ":port=".$port;
 			$this->setUri("dbi:". $this->getDbType() .":dbname=". $this->getDbName() .";host=". $host);
 		}
+	  elseif ($this->getDbType() == "Sybase") {
+	    $this->setUri("dbi:". $this->getDbType() .":database=". $this->getDbName() .";server=". $host);
+	  }
 	}
 	
 	function getDbType() {
-		if (ereg("dbi:([[:alnum:]]*):dbname=[[:alnum:]]*",$this->getUri(), $regs)) return $regs[1];
+		if (ereg("dbi:([[:alnum:]]*):(dbname|database)=[[:alnum:]]*",$this->getUri(), $regs)) return $regs[1];
 	}
 	
 	function setDbType($db_type) {

