remove some unused functions and migrated some more functions to PDO database class, refs #1287
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -17,24 +17,22 @@
|
||||
*
|
||||
*/
|
||||
|
||||
function getIpAddresses()
|
||||
{
|
||||
global $db, $theme;
|
||||
|
||||
$query = 'SELECT `id`, `ip`, `port` FROM `' . TABLE_PANEL_IPSANDPORTS . '` ORDER BY `ip` ASC, `port` ASC';
|
||||
$result = $db->query($query);
|
||||
function getIpAddresses() {
|
||||
|
||||
$result_stmt = Database::query("
|
||||
SELECT `id`, `ip`, `port` FROM `" . TABLE_PANEL_IPSANDPORTS . "` ORDER BY `ip` ASC, `port` ASC
|
||||
");
|
||||
|
||||
$system_ipaddress_array = array();
|
||||
|
||||
while($row = $db->fetch_array($result))
|
||||
{
|
||||
if(!isset($system_ipaddress_array[$row['ip']])
|
||||
&& !in_array($row['ip'], $system_ipaddress_array))
|
||||
{
|
||||
if(filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))
|
||||
{
|
||||
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
|
||||
if (!isset($system_ipaddress_array[$row['ip']])
|
||||
&& !in_array($row['ip'], $system_ipaddress_array)
|
||||
) {
|
||||
if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
||||
$row['ip'] = '[' . $row['ip'] . ']';
|
||||
}
|
||||
|
||||
$system_ipaddress_array[$row['ip']] = $row['ip'];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user