diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index 3ee201c4..197d5f1f 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -853,9 +853,9 @@ if(isFroxlorVersion('0.9.10-svn1')) $result = $db_root->query("SHOW DATABASES;"); while($row = $db_root->fetch_array($result)) { - if(preg_match('/^web([0-9]+)aps([0-9]+)$/', $row['Database'])) + if(preg_match('/^web([0-9]+)aps([0-9]+)$/', $row['Database'], $matches)) { - $cid = substr($row['Database'], 3, strpos($row['Database'], 'aps')- 3); + $cid = $matches[1]; $databasedescription = 'APS DB'; $result = $db->query('INSERT INTO `' . TABLE_PANEL_DATABASES . '` (`customerid`, `databasename`, `description`, `dbserver`, `apsdb`) VALUES ("' . (int)$cid . '", "' . $db->escape($row['Database']) . '", "' . $db->escape($databasedescription) . '", "0", "1")'); $result = $db->query('UPDATE `' . TABLE_PANEL_CUSTOMERS . '` SET `mysqls_used`=`mysqls_used`+1 WHERE `customerid`="' . (int)$cid . '"');