Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions admin/src/Table/AllowTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

defined('_JEXEC') or die;

use Codeling\Plugin\System\Bfstop\Helper\IpHelper;
use Joomla\CMS\Table\Table;
use Joomla\Database\DatabaseDriver;

Expand All @@ -30,6 +31,14 @@ public function check()
{
$this->id = 0;
}
// addresses and networks are looked up by their canonical spelling, see
// IpHelper::canonicalEntry() ("2001:DB8::1" and "203.0.113.5/24" are
// kept as "2001:db8::1" and "203.0.113.0/24")
$canonical = IpHelper::canonicalEntry($this->ipaddress);
if ($canonical !== null)
{
$this->ipaddress = $canonical;
}
return parent::check();
}
}
9 changes: 9 additions & 0 deletions admin/src/Table/BlockTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

defined('_JEXEC') or die;

use Codeling\Plugin\System\Bfstop\Helper\IpHelper;
use Joomla\CMS\Table\Table;
use Joomla\Database\DatabaseDriver;

Expand All @@ -30,6 +31,14 @@ public function check()
{
$this->id = 0;
}
// addresses and networks are looked up by their canonical spelling, see
// IpHelper::canonicalEntry() ("2001:DB8::1" and "203.0.113.5/24" are
// kept as "2001:db8::1" and "203.0.113.0/24")
$canonical = IpHelper::canonicalEntry($this->ipaddress);
if ($canonical !== null)
{
$this->ipaddress = $canonical;
}
return parent::check();
}
}
Loading